摘要: 判断文件存在用is_file还是file_exists?在写程序时发现在判断文件是否存在时,有两种写法,有的人用了is_file,有的人用了file_exists,用哪个更好或者说更合适呢?看了这篇PHP中file_exists与is_file,is_dir的区别的说法基本明白,PHP的 file_exists = is_dir + is_file。写程序验证一下:分别执行1000次,记录所需时间。文件存在(当前目录)is_file:0.4570msfile_exists:2.0640ms文件存在(绝对路径3层/www/hx/a/)is_file:0.4909msfile_exists:3.3 阅读全文
posted @ 2012-09-11 09:47 赤脚大仙~ 阅读(1822) 评论(1) 推荐(0) 编辑
View Code