php file_exists()函数
发布时间:2020-05-25 22:37:09 所属栏目:PHP 来源:互联网
导读:php file_exists()函数检查文件或目录是否存在, 本文章向大家介绍php file_exists()函数的基本使用方法和实例,需要的朋友可以参考一下。
定义file_exists()函数检查文件或目录是否存在。 语法PHP file_exists()函数具有以下语法。 file_exists(path) 参数参数 是否必须 描述 path 需要。 检查路径 返回值如果filename指定的文件或目录存在,则返回TRUE;否则为FALSE。 实例file_exists()如果文件存在则返回true,否则返回false。 在尝试打开文件之前,我们可以使用file_exists()来发现文件是否存在: /* http://www.manongjc.com/article/1790.html 作者:脚本之家教程 */ if (file_exists("data.txt")) { print "data.txt exists!n"; } else { print "data.txt does not exist!n"; } echo file_exists("data.txt"); ?> 上面的代码生成以下结果: data.txt does not exist! (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |