小白教程
所有教程
关于
Search
172.70.130.238
172.70.130.238
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“PHP 5 Filesystem 函数”的源代码
本页内容
上一节:
PHP_Error_和_Logging_函数
下一节:
PHP_Filter_函数
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:PHP Filesystem}}[[Category:PHP 教程|76]] = PHP Filesystem 函数 = == PHP Filesystem 简介 == Filesystem 函数允许您访问和操作文件系统。 == 安装 == Filesystem 函数是 PHP 核心的组成部分。无需安装即可使用这些函数。 == Runtime 配置 == Filesystem 函数的行为受到 php.ini 中设置的影响。 Filesystem 配置选项: {| class="table table-striped table-hover" ! 名称 ! 默认 ! 描述 ! 可改变 |- | allow_url_fopen | "1" | 允许 fopen()-type 函数使用 URL。(PHP 4.0.4 版以后可用) | PHP_INI_SYSTEM |- | user_agent | NULL | 定义 PHP 发送的用户代理。(PHP 4.3 版以后可用) | PHP_INI_ALL |- | default_socket_timeout | "60" | 设置基于 socket 流的默认的超时时间(秒)。(PHP 4.3 版以后可用) | PHP_INI_ALL |- | from | "" | 定义匿名 FTP 的密码(您的 email 地址)。 | PHP_INI_ALL |- | auto_detect_line_endings | "0" | 当设置为 "1" 时,PHP 将检查通过 fgets() 和 file() 取得的数据中的行结束符号是符合 Unix、MS-Dos 还是 Mac 的习惯。(PHP 4.3 版以后可用) | PHP_INI_ALL |} == Unix / Windows 兼容性 == 当在 Unix 平台上规定路径时,正斜杠 (/) 用作目录分隔符。而在 Windows 平台上,正斜杠 (/) 和反斜杠 (\) 均可使用。 == PHP 5 Filesystem 函数 == {| class="table table-striped table-hover" ! 函数 ! 描述 |- | [[func filesystem basename|basename()]] | 返回路径中的文件名部分。 |- | [[func filesystem chgrp|chgrp()]] | 改变文件组。 |- | [[func filesystem chmod|chmod()]] | 改变文件模式。 |- | [[func filesystem chown|chown()]] | 改变文件所有者。 |- | [[func filesystem clearstatcache|clearstatcache()]] | 清除文件状态缓存。 |- | [[func filesystem copy|copy()]] | 复制文件。 |- | delete() | 参见 unlink() 或 unset() |- | [[func filesystem dirname|dirname()]] | 返回路径中的目录名称部分。 |- | [[func filesystem disk free space|disk_free_space()]] | 返回目录的可用空间。 |- | [[func filesystem disk total space|disk_total_space()]] | 返回一个目录的磁盘总容量。 |- | [[func filesystem diskfreespace|diskfreespace()]] | disk_free_space() 的别名。 |- | [[func filesystem fclose|fclose()]] | 关闭打开的文件。 |- | [[func filesystem feof|feof()]] | 测试文件指针是否到了文件末尾。 |- | [[func filesystem fflush|fflush()]] | 向打开的文件刷新缓冲输出。 |- | [[func filesystem fgetc|fgetc()]] | 从打开的文件中返回字符。 |- | [[func filesystem fgetcsv|fgetcsv()]] | 从打开的文件中解析一行,校验 CSV 字段。 |- | [[func filesystem fgets|fgets()]] | 从打开的文件中返回一行。 |- | [[func filesystem fgetss|fgetss()]] | 从打开的文件中返回一行,并过滤掉 HTML 和 PHP 标签。 |- | [[func filesystem file|file()]] | 把文件读入一个数组中。 |- | [[func filesystem file exists|file_exists()]] | 检查文件或目录是否存在。 |- | [[func filesystem file get contents|file_get_contents()]] | 把文件读入字符串。 |- | [[func filesystem file put contents|file_put_contents()]] | 把字符串写入文件。 |- | [[func filesystem fileatime|fileatime()]] | 返回文件的上次访问时间。 |- | [[func filesystem filectime|filectime()]] | 返回文件的上次修改时间。 |- | [[func filesystem filegroup|filegroup()]] | 返回文件的组 ID。 |- | [[func filesystem fileinode|fileinode()]] | 返回文件的 inode 编号。 |- | [[func filesystem filemtime|filemtime()]] | 返回文件内容的上次修改时间。 |- | [[func filesystem fileowner|fileowner()]] | 返回文件的用户 ID (所有者)。 |- | [[func filesystem fileperms|fileperms()]] | 返回文件的权限。 |- | [[func filesystem filesize|filesize()]] | 返回文件大小。 |- | [[func filesystem filetype|filetype()]] | 返回文件类型。 |- | [[func filesystem flock|flock()]] | 锁定或释放文件。 |- | [[func filesystem fnmatch|fnmatch()]] | 根据指定的模式来匹配文件名或字符串。 |- | [[func filesystem fopen|fopen()]] | 打开一个文件或 URL。 |- | [[func filesystem fpassthru|fpassthru()]] | 从打开的文件中读数据,直到文件末尾(EOF),并向输出缓冲写结果。 |- | [[func filesystem fputcsv|fputcsv()]] | 把行格式化为 CSV 并写入一个打开的文件中。 |- | [[func filesystem fputs|fputs()]] | fwrite() 的别名。 |- | [[func filesystem fread|fread()]] | 读取打开的文件。 |- | [[func filesystem fscanf|fscanf()]] | 根据指定的格式对输入进行解析。 |- | [[func filesystem fseek|fseek()]] | 在打开的文件中定位。 |- | [[func filesystem fstat|fstat()]] | 返回关于一个打开的文件的信息。 |- | [[func filesystem ftell|ftell()]] | 返回在打开文件中的当前位置。 |- | [[func filesystem ftruncate|ftruncate()]] | 把打开文件截断到指定的长度。 |- | [[func filesystem fwrite|fwrite()]] | 写入打开的文件。 |- | [[func filesystem glob|glob()]] | 返回一个包含匹配指定模式的文件名/目录的数组。 |- | [[func filesystem is dir|is_dir()]] | 判断文件是否是一个目录。 |- | [[func filesystem is executable|is_executable()]] | 判断文件是否可执行。 |- | [[func filesystem is file|is_file()]] | 判断文件是否是常规的文件。 |- | [[func filesystem is link|is_link()]] | 判断文件是否是连接。 |- | [[func filesystem is readable|is_readable()]] | 判断文件是否可读。 |- | [[func filesystem is uploaded file|is_uploaded_file()]] | 判断文件是否是通过 HTTP POST 上传的。 |- | [[func filesystem is writable|is_writable()]] | 判断文件是否可写。 |- | [[func filesystem is writeable|is_writeable()]] | is_writable() 的别名。 |- | lchgrp() | 改变符号连接的组所有权。 |- | lchown() | 改变符号连接的用户所有权。 |- | [[func filesystem link|link()]] | 创建一个硬连接。 |- | [[func filesystem linkinfo|linkinfo()]] | 返回有关一个硬连接的信息。 |- | [[func filesystem lstat|lstat()]] | 返回关于文件或符号连接的信息。 |- | [[func filesystem mkdir|mkdir()]] | 创建目录。 |- | [[func filesystem move uploaded file|move_uploaded_file()]] | 把上传的文件移动到新位置。 |- | [[func filesystem parse ini file|parse_ini_file()]] | 解析一个配置文件。 |- | parse_ini_string() | 解析一个配置字符串。 |- | [[func filesystem pathinfo|pathinfo()]] | 返回关于文件路径的信息。 |- | [[func filesystem pclose|pclose()]] | 关闭由 popen() 打开的进程。 |- | [[func filesystem popen|popen()]] | 打开一个进程。 |- | [[func filesystem readfile|readfile()]] | 读取一个文件,并写入到输出缓冲。 |- | [[func filesystem readlink|readlink()]] | 返回符号连接的目标。 |- | [[func filesystem realpath|realpath()]] | 返回绝对路径名。 |- | realpath_cache_get() | 返回高速缓存条目。 |- | realpath_cache_size() | 返回高速缓存大小。 |- | [[func filesystem rename|rename()]] | 重命名文件或目录。 |- | [[func filesystem rewind|rewind()]] | 倒回文件指针的位置。 |- | [[func filesystem rmdir|rmdir()]] | 删除空的目录。 |- | [[func filesystem set file buffer|set_file_buffer()]] | 设置已打开文件的缓冲大小。 |- | [[func filesystem stat|stat()]] | 返回关于文件的信息。 |- | [[func filesystem symlink|symlink()]] | 创建符号连接。 |- | [[func filesystem tempnam|tempnam()]] | 创建唯一的临时文件。 |- | [[func filesystem tmpfile|tmpfile()]] | 创建唯一的临时文件。 |- | [[func filesystem touch|touch()]] | 设置文件的访问和修改时间。 |- | [[func filesystem umask|umask()]] | 改变文件的文件权限。 |- | [[func filesystem unlink|unlink()]] | 删除文件。 |}
返回至“
PHP 5 Filesystem 函数
”。
上一节:
PHP_Error_和_Logging_函数
下一节:
PHP_Filter_函数