3.isset()判断一个变量是否定义
if (isset($var)) {
print "This var is set set so I will print.";
}
4.function_exists判断一个函数是否定义
if(function_exists(‘date_default_timezone_set‘))//检查函数是否定义
{
date_default_timezone_set("Asia/Chongqing");
}
5.file_exists判断一个文件是否存在
<?php
$file = ‘/www/index.php‘;
if (file_exists($file)) {
echo "$file";
} else {
echo "false";
}
?>
原文:http://www.cnblogs.com/php-linux/p/5219653.html