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

求帮写一个php代码

WBOY
Release: 2016-06-23 14:00:26
Original
884 people have browsed it

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


回复讨论(解决方案)

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