时间:2021-07-01 10:21:17 帮助过:1人阅读
opendir() 函数语法
opendir(path,context);
| 参数 | 描述 |
|---|---|
| path | 必需。规定要打开的目录路径。 |
| context | 可选。规定目录句柄的环境。context 是可修改目录流的行为的一套选项。 |
opendir() 函数实例,代码如下:
$dirs ='./';//指定当前上当
if( is_dir( $dirs ) )
{
$hanld = opendir($dirs);
while (($file = readdir($hanld)) !== false)
{
echo "文件名: " . $file . "<br />";
}
closedir($hanld);
}
else
{
echo '不是目录';
}输出结果:
文件名:a
文件名:b
文件名:www.gxlcms.com
以上就是php中opendir函数的简单用法说明?的详细内容,更多请关注Gxl网其它相关文章!