Listing the Contents of a Directory with readdir()
|
<html> <head> <title>Listing the contents of a directory with readdir()</title> </head> <body> <?php $dirname = "./"; $dh = opendir( $dirname ); while ( gettype( $file = readdir( $dh )) != boolean ){ if ( is_dir( "$dirname/$file" ) ) print "(D)"; print "$file<br>"; } closedir( $dh ); ?> </body> </html>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
|