Home >Backend Development >PHP Tutorial >求帮写一个php代码解决办法

求帮写一个php代码解决办法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:52:01842browse

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

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

------解决方案--------------------
接分

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
Previous article:PHP数组有关问题,Next article:php 双向行列