<?php
$ch= curl_init();
$timeout= 5;
curl_setopt ($ch, CURLOPT_URL, 'https://api.xxx.xxx/xxx');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents= curl_exec($ch);
curl_close($ch);
preg_match('/https?:\/{2}[-A-Za-z0-9+&@#\/\%?=~_|!:,.;]+[-A-Za-z0-9+&@#\/\%=~_|]/i',$file_contents, $matches);
$url = $matches[0];
echo"<script>window.location.href='$url';</script>";
?>
PHP------图片API劫持
共计 0 条评论,点此发表评论