2018.12.14
2808
小平
function actionWechatImg() {
header('Content-type: image/jpg');
$url = $_GET['url'];
$refer = "http://www.qq.com/";
$opt = [ 'http'=>[ 'header'=>"Referer: " . $refer
]
];
$context = stream_context_create($opt);
$file_contents = file_get_contents($url,false, $context); echo $file_contents;
}
调试用例
<img src="http://xxx.com.cn/weixinimg?url=http%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz%2F5ddyukqqNUt7ic07NicfAz9u0KrHEibKKMiab2cXA2sIqoj81hRsMZC65DCiaN67FsH2WaXkNOEE0YFLj5OHwIOegIg%2F0%3Fwx_fmt%3Djpeg">
免责声明:以上内容源自网络,版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。