Home > Backend Development > PHP Tutorial > php lists all php files in the current directory

php lists all php files in the current directory

WBOY
Release: 2016-07-25 08:44:14
Original
1102 people have browsed it

php lists all php files in the current directory

  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."< ;br>";
  9. }
  10. ?>
Copy code

directory, php


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