当前位置: 首页> 函数类别大全> file_exists

file_exists

检查文件或目录是否存在
名称:file_exists
分类:文件系统
所属语言:php
一句话介绍:检查文件或目录是否存在。

定义和用法

file_exists() 函数检查文件或目录是否存在。

如果指定的文件或目录存在则返回 true,否则返回 false。

实例

<?php
echo file_exists("test.txt");
?>

输出:

1

语法

file_exists(path)
参数 描述
path 必需。规定要检查的路径。
同类函数
  • 参见 unlink() 或 unset()(PHP 没有 delete 关键词或函数)  delete

    delete

    参见unlink()或unset()(P
  • 修改符号链接的所有组  lchgrp

    lchgrp

    修改符号链接的所有组
  • 重命名文件或目录  rename

    rename

    重命名文件或目录
  • 获取文件修改时间  filemtime

    filemtime

    获取文件修改时间
  • 关闭进程文件指针  pclose

    pclose

    关闭进程文件指针
  • 获取文件类型  filetype

    filetype

    获取文件类型
  • 写入文件(可安全用于二进制文件)  fwrite

    fwrite

    写入文件(可安全用于二进制文件)
  • disk_free_space 的别名  diskfreespace

    diskfreespace

    disk_free_space的别名
热门文章