php获取本地图片直接输出浏览器,file_get_contents

来源:互联网 发布:始知官职为他人 编辑:程序博客网 时间:2024/05/21 15:43

php获取本地图片直接输出浏览器,file_get_contents


$url = 'www.12345t.com/?code;
//file_get_contents($url,true); 可以读取远程图片,也可以读取本地图片
$img = file_get_contents($url,true);
//使用图片头输出浏览器
header("Content-Type: image/jpeg;text/html; charset=utf-8");
echo $img;
exit;
原创粉丝点击