新建txt文件,另存为php文件,内容如下
<?php
$path = dirname(__FILE__);
$file = file($path."/imgurl.txt");
$arr = mt_rand( 0, count( $file ) - 1 );
$url = trim($file[$arr]);
#echo $url;
if (isset($url))
{
Header("HTTP/1.1 303 See Other");
Header("Location: $url");
exit;
}
?>
新建一个imgurl.txt文件,放入图片url地址,每行一个
https://tvax3.sinaimg.cn/large/da6ac54fgy1gl0a24ihraj23344mo7wj.jpg
https://tva2.sinaimg.cn/large/da6ac54fgy1gl0a25fvbzj24mo334npf.jpg
https://tva4.sinaimg.cn/large/da6ac54fgy1gl0a26cfflj24mo3347wj.jpg
https://tvax2.sinaimg.cn/large/da6ac54fgy1gl0a2790cnj24mo334kjn.jpg
https://tvax1.sinaimg.cn/large/da6ac54fgy1gl0a2872agj24mo3341kz.jpg
https://tvax1.sinaimg.cn/large/da6ac54fgy1gl0a292zb3j23344mokjm.jpg
成品如下:
本文来自投稿,不代表本站立场,如若转载,请注明出处: