Web开发技巧集锦(2):php生成随机文件并记录
<?php
$name=[];
$strs="QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm";
for($i=0;$i<30;$i++){
$name[$i]=substr(str_shuffle($strs),0,50);
if (!is_dir($name[$i].'/')) mkdir($name[$i].'/');
if (!file_exists($name[$i].'/index.php')) file_put_contents($name[$i].'/index.php', '<?php $fh= file_get_contents("1.txt");echo $fh; ?>');
file_put_contents('xyz.txt', "http://dio.xyz/list4100/".$name[$i]."\n", FILE_APPEND);
file_put_contents('top.txt', "http://yan.top/list4100/".$name[$i]."\n", FILE_APPEND);
}
?>
版权声明
本文仅代表作者观点,不代表博信信息网立场。