chdir : 改变目录。
dir : 目录类别类。
closedir : 关闭目录 handle。
opendir : 打开目录 handle。
readdir : 读取目录 handle。
rewinddir : 重设目录 handle。
chdir
改变目录。
语法: int chdir(string directory);
返回值: 整数
函数种类: 文件存取
内容说明 本函数用来改变目前 PHP 执行的目录到新的 directory 目录中。若无法改变则返回 false,成功则返回 true。
dir
目录类别类。
语法: new dir(string directory);
返回值: 类
函数种类: 文件存取
内容说明 这是一个类似面向对象的类别类,用来读取目录。当目录参数 directory 打开之后,有二个属性可用:handle 属性就像其它非类的函数所用的 readdir()、rewinddir() 及 closedir();path 属性则配置打开目录后的路径参数。本类有三个方法 (method):read、rewind 与 close。
使用范例
$d = dir("/etc");
echo "Handle: ".$d->handle."
n";
echo "Path: ".$d->path."
n";
while($entry=$d->read()) {
echo $entry."
n";
}
$d->close();
?>
closedir
关闭目录 handle。
语法: void closedir(int dir_handle);
返回值: 无
函数种类: 文件存取
内容说明
本函数用来关闭目录资料流的 dir_handle。这个 dir_handle 参数所操作的目录必须要 opendir() 打开的方可使用。
opendir
打开目录 handle。
语法: int opendir(string path);
返回值: 整数
函数种类: 文件存取
内容说明
本函数用来打开目录资料流。返回的整数是可供其它目录函数操作的 handle。
readdir
读取目录 handle。
语法: string readdir(int dir_handle);
返回值: 字符串
函数种类: 文件存取
内容说明 本函数用来读取目录。返回目录中的文件名称,读取不照任何非凡的顺序。
使用范例 本例列出目前目录的所有文件
$handle=opendir('.');
echo "目录 handle: $handle ";
echo "文件: ";
while ($file = readdir($handle)) {
echo "$file ";
}
closedir($handle);
?>
rewinddir
重设目录 handle。
语法: void rewinddir(int dir_handle);
返回值: 无
函数种类: 文件存取
内容说明 本函数用来重设目录资料流到开始处。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools
