Sun Oct 26, 2008 8:42 pm
<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>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.