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); Link to comment https://forums.phpfreaks.com/topic/33118-what-is-this/ 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 Link to comment https://forums.phpfreaks.com/topic/33118-what-is-this/#findComment-154299 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 Link to comment https://forums.phpfreaks.com/topic/33118-what-is-this/#findComment-154301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.