假设您知道文件所在的文件夹以及文件是PHP文件:
$phpFiles = glob('/path/to/files/*.php');
if (empty($phpFiles) === false)
{
$randomFile = $phpFiles[array_rand($phpFiles)];
include($randomFile);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
895 次 |
| 最近记录: |