帮我看下这代码是否规范,if语句判断
$hosturl=$_SERVER['PHP_SELF']; //获取当前url
if $hosturl="/index.php" //如果URL等于/index.php,就输入body字段的内容
{
$s['body'];
exit;
}
这代码哪里有问题吗?
[解决办法]
有问题。
1 if(xxx) ,没有括号。
2 = 是赋值; == 是条件判断
发布时间: 2013-01-09 09:38:15 作者: rapoo
帮我看下这代码是否规范,if语句判断
$hosturl=$_SERVER['PHP_SELF']; //获取当前url
if $hosturl="/index.php" //如果URL等于/index.php,就输入body字段的内容
{
$s['body'];
exit;
}