首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

php判断目录下的文件是否存在

2012-04-04 
求助php判断目录下的文件是否存在刚刚接触php,求助大家怎么在php中判断某个目录下的文件是否存在?这个我执

求助php判断目录下的文件是否存在
刚刚接触php,求助大家怎么在php中判断某个目录下的文件是否存在?
这个我执行有错误。麻烦大家帮看看,先谢谢各位了。

$file = "../language/$yy.php";
if (is_file($file) == false) { 
  require("../language/$yy.php"); } 
else {
  require("../language/m.php"); }
 clearstatcache();


[解决办法]

PHP code
 $filename =   "../language/$yy.php";if (file_exists($filename)) {    //do some thing} else {   //do other thing} 

热点排行