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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:52:01
Original
841 people have browsed it

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template