输入banner图图片脚本导航/分类

PHP读取目录下所有文件的代码_PHP教程

读取目录下所有文件的代码,可以不管文件名
代码如下:
$dir = "file";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {

while (($file = readdir($dh)) !== false) {
if ($file!="." && $file!="..") {
echo "".$file."
";
}
}
closedir($dh);
}
}
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318545.htmlTechArticle读取目录下所有文件的代码,可以不管文件名 代码如下:

?php $dir="file"; //Openaknowndirectory,andproceedtoreaditscontents if(is_dir($dir)){ if($dh=op...