Home > Backend Development > PHP Tutorial > 帮小弟我看上这代码是否规范,if语句判断

帮小弟我看上这代码是否规范,if语句判断

WBOY
Release: 2016-06-13 12:57:43
Original
813 people have browsed it

帮我看下这代码是否规范,if语句判断

<br />
$hosturl=$_SERVER['PHP_SELF']; //获取当前url<br />
if $hosturl="/index.php"   //如果URL等于/index.php,就输入body字段的内容<br />
{<br />
	$s['body'];<br />
	exit;<br />
}<br />
Copy after login



这代码哪里有问题吗?

------解决方案--------------------
有问题。 
1 if(xxx)  ,没有括号。
2 = 是赋值; == 是条件判断

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template