Re: [請益] 用php輸出圖片
※ 引述《knives ()》之銘言:
: 我希望讓user輸入網址如 xxx.php?id=nn
: 就輸出圖片,該圖片是早就放在主機的目錄,像是 /xxx/yyy/zzz.gif
以你的 gif 為例
resource imagecreatefromgif ( string $filename )
例如
$img = imagecreatefromgif('/xxx/yyy/zzz.gif');
: 我在前面表頭用
: header("Content-type: image/gif");
: 可是我要怎麼輸出圖片
輸出
header('Content-Type: image/gif');
imagegif($img);
imagedestroy($img);
以上你要安裝 php 的 gd extension 才能用。
--
The Internet: where men are men, women are men, and children are FBI agents.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 202.89.121.16
→
12/10 18:20, , 1F
12/10 18:20, 1F
※ 編輯: roga 來自: 202.89.121.16 (12/10 18:24)
推
12/11 01:40, , 2F
12/11 01:40, 2F
推
12/11 09:13, , 3F
12/11 09:13, 3F
→
12/11 09:15, , 4F
12/11 09:15, 4F
推
12/11 09:17, , 5F
12/11 09:17, 5F
→
12/11 09:18, , 6F
12/11 09:18, 6F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
6
14