Last active
August 29, 2015 13:56
-
-
Save karloscarweber/8830520 to your computer and use it in GitHub Desktop.
_islegit() checks if a variable is set and not empty. eliminates a lot of extra code in the long run. Seems kinda silly if you just take it as it is.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Checks if something is set and not empty | |
Pass the variable as a reference to truly check its | |
legitness. | |
*/ | |
function _islegit(&$variable = null) | |
{ | |
if($variable) { | |
if(isset($variable) && !empty($variable) ) { | |
return true; | |
} else { | |
return false; | |
} | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment