php 获取指定文件夹内的文件名,不要扩展名

2024-11-01 17:31:06
推荐回答(1个)
回答(1):

试试这个
$path = array("./test");//文件夹名
foreach($path as $val){
$dir_handle = @opendir($val) or die("Unable to open $val");
echo "Directory Listing of $val
";
while ($file = readdir($dir_handle))
{
echo "";
}
closedir($dir_handle);
echo "
";
}
?>