如何查询当前目录下所有PHP文件的列表?
- 内容介绍
- 文章标签
- 相关推荐
本文共计66个文字,预计阅读时间需要1分钟。
php列出当前目录下所有.php文件:
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=changetoyoursite/$value>".$value."</a><br>"; } ?>
本文共计66个文字,预计阅读时间需要1分钟。
php列出当前目录下所有.php文件:
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=changetoyoursite/$value>".$value."</a><br>"; } ?>

