PHP 仅列出PHP文件夹中的某些文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 仅列出PHP文件夹中的某些文件相关的知识,希望对你有一定的参考价值。

<?php
//Define directory for files listing
//original example
//$files = glob('/path/to/dir/*.xml');
$files = glob('*.php');
//to limit what is displayed you can use a diff listing:
//$files = array_diff($files, array('index.php','opendb.php'));

foreach ($files as $value) {
echo "<a href=http://changetoyoursite/$value>".$value."</a><br>";
}


?>

以上是关于PHP 仅列出PHP文件夹中的某些文件的主要内容,如果未能解决你的问题,请参考以下文章