web 2.0

How to use PHP & Scandir() List Directory

How to use PHP & Scandir() List Directory Learn how to use the PHP to List Directory and using Scandir()

ShotDev Focus:
- PHP & List Directory by Scandir()

Example

php_scandir.php

  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <?php  
  7. $objScan = scandir("shotdev");  
  8. foreach ($objScan as $value) {  
  9. echo "folder : $value<br>";  
  10. }  
  11. ?>  
  12. </body>  
  13. </html>  

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_scandir.php

Screenshot

PHP List Directory by Scandir()
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.