列出 images 目录中的文件和目录:
<?php
$dir = "/images/";
$a = scandir($dir);
$b = scandir($dir,1);
print_r($a);
print_r($b);
?>
结果:
Array
(
[0] => .
[1] => ..
[2] => cat.gif
[3] => dog.gif
[4] => horse.gif
[5] => myimages
)
Array
(
[0] => myimages
[1] => horse.gif
[2] => dog.gif
[3] => cat.gif
[4] => ..
[5] => .
)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容