PHP判断目录是否存在方法可以使用is_dir()函数,使用方法很简单,示例代码如下:
<?php
header("Content-type:text/html;charset=utf-8");
$file = "img/";
if(is_dir($file))
{
echo "目录".$file." 存在";
}
else
{
echo "目录".$file."不存在";
}
?>
PHP判断目录是否存在方法可以使用is_dir()函数,使用方法很简单,示例代码如下:
<?php
header("Content-type:text/html;charset=utf-8");
$file = "img/";
if(is_dir($file))
{
echo "目录".$file." 存在";
}
else
{
echo "目录".$file."不存在";
}
?>