The code above print 1. It works fine.Code:code1 <?php $myVar=1; if (!$myVar==0) { echo $myVar; } ?> //if $myVar is not 0, then print $myVar.
I am expecting that the code above print 1.Code:code2 <?php $myVar=1; if (!$myVar==2) { echo $myVar; } ?> //if $myVar is not 2, then print $myVar.
But it doesn't print 1.
What's wrong in the code2?
How can I correctly write for the meaning of "if $myVar is not 2, then print $myVar."?



Reply With Quote





Bookmarks