Trouble With If statement PHP

北城以北 提交于 2019-12-25 03:29:42

问题


I have been scripting PHP for for about 9 months now and im starting to run into a problem with my if conditions. This has never happened before.

if ($reason != "9ee1e1f4fbf1"){
    XXXXXXXXX
}

I even tried putting the 9ee1ef4fbf1 in parenthesis and that didnt work. i keep getting this:

Parse error: syntax error, unexpected T_IF in /home/content/49/549/html/index.php on line 21

回答1:


The problem is in the line above the if. Maybe forgot a semicolon?




回答2:


Please post the lines before the if statement. Usually, when you get an unexpected ____ error in PHP, it means you left out a semi-colon or something like that.




回答3:


The T_IF token is unexpected, probably because PHP was in a parsing state that wasn't finished by an ending delimiter (perhaps the end of line semi-colon (;)).




回答4:


You should look at anything before the if, maybe you are missing a semicolon(;).



来源:https://stackoverflow.com/questions/4210343/trouble-with-if-statement-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!