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

  • Post author:
  • Post category:php


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;



版权声明:本文为qq_38256963原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。