Jump to content

What is !$this


Mutley

Recommended Posts

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 empty

If 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.