Mutley Posted January 6, 2007 Share Posted January 6, 2007 I tried searching but it never picks up punctuation, anyway.If I see a variable with an explanation what does it mean? Where can I find a list of definitions for this type of thingif([b]![/b]$this); Quote Link to comment Share on other sites More sharing options...
taith Posted January 6, 2007 Share Posted January 6, 2007 $this=true;if($this) echo true; #$this==trueif(!$this) echo false; #$this==false Quote Link to comment Share on other sites More sharing options...
Hypnos Posted January 6, 2007 Share Posted January 6, 2007 It also works similar to isset, only it will return a FALSE if the string is set but empty.[code=php:0]$a = "A";$b = "";if($a) echo "\$a is not empty";else echo "\$a is empty";if($b) echo "\$b is not empty";else echo "\$b is empty";[/code]This code would echo:$a is not empty$b is emptyIf you used if(isset()) instead, it would say that both are not empty.EDIT:And of course "!" just says "if it is not".http://www.w3schools.com/php/php_operators.asp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.