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

WebStorm Mac version
Useful JavaScript development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools
