当前位置:Gxlcms > PHP教程 > php列出当前目录下的所有php文件

php列出当前目录下的所有php文件

时间:2021-07-01 10:21:17 帮助过:30人阅读

php列出当前目录下的所有php文件

  1. //Define directory for files listing
  2. //original example
  3. //$files = glob('/path/to/dir/*.xml');
  4. $files = glob('*.php');
  5. //to limit what is displayed you can use a diff listing:
  6. //$files = array_diff($files, array('index.php','opendb.php'));
  7. foreach ($files as $value) {
  8. echo "".$value."
    ";
  9. }
  10. ?>

目录下, php

人气教程排行