Revision: 33382
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 8, 2010 07:48 by vagrantradio
Initial Code
$dir = "."; if( is_dir( $dir ) ){ if( $dir_handle = opendir( $dir ) ){ while( $filename = readdir( $dir_handle ) ){ echo "filename: {$filename}<br />" ; } //rewinddir($dir_handle) to start over closedir( $dir_handle ); } } echo "<hr />"; if( is_dir( $dir ) ){ $dir_array = scandir( $dir ); foreach( $dir_array as $file ){ if( stripos( $file, '.' ) > 0){ echo "filename: {$file}<br />"; } } }
Initial URL
Initial Description
Prints out the contents of a directory.
Initial Title
List items in directory
Initial Tags
php
Initial Language
PHP