
Originally Posted by
kuau
I have seen
if(isset
if (!empty
If($var != " ")
Do they all do the same thing?
No, not all of them. I think:
Code:
if (!empty
If($var != " ")
does the same thing.
But, isset, checks if something is. Like:
Code:
$name = (isset($_GET['name'])) ? $_GET['name'] : $default;
This will check if there is "name". This won't check if it is empty or not. But:
Code:
$name = (!empty($_GET['name'])) ? $_GET['name'] : $default;
this will check if it is not empty, set the $name = $_GET['name'], if not make default.
I hope you understood me, and i could help you
Bookmarks