Re: [請益] 抓圖
用 file_get_contents() 即可,傳入圖片網址。
抓完後有兩個選擇,一是直接輸出給瀏覽器看,二是存檔到伺服器上。
$img = file_get_contents("http://de2.php.net/images/php.gif", 0);
// 一
header('Content-Type: images/gif');
echo $img;
// 二
$f = fopen("123php.gif", "w");
fwrite($f, $img);
fclose($f);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.117.202.109
討論串 (同標題文章)