用下面的代码保存为index.php
<?php 
$img=file('img.txt');
$url=array_rand($img);
header("Location:".$img[$url]); 
?>在同级目录创建img.txt,一行一个图片链接。然后访问index.php即可。
https://cdn.jsdelivr.net/gh/tdrme/tdrme.github.io@master/20211201120150257.jpg
https://cdn.jsdelivr.net/gh/tdrme/tdrme.github.io@master/20211201120150249.jpg
https://cdn.jsdelivr.net/gh/tdrme/tdrme.github.io@master/20211201120034801.jpg 
                                
评论