Home  >  Article  >  Backend Development  >  求帮写一个php代码

求帮写一个php代码

WBOY
WBOYOriginal
2016-06-23 14:00:26848browse

假如我访问首页index.php时候  这个index.php会自动跳转到指定的文件夹下的随机访问所有静态.html 页面,如果改文件夹下有100个静态页面  ,他每次访问都是随机访问该文件下下的任意一个静态页面。谢谢


回复讨论(解决方案)

$ar = glob('path/*'); //获取指定目录下的所有文件名shuffle($ar); //将结果数组打乱header("Location: $ar[0]"); //跳转

接分

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn