<?php $dir = "./"; // open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo "filename: $file : filetype: " . filetype($dir . $file) . "n"."<br />"; } closedir($dh); } } ?>
希望本文所述对大家的PHP程序设计有所帮助。