Last active
August 29, 2015 14:15
-
-
Save u01jmg3/b420b0d9b16dffbe0846 to your computer and use it in GitHub Desktop.
Quick function to check if a value is blank including returning `0` as not blank.
This file contains hidden or 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
/** | |
* @param Mixed | |
* @return Boolean | |
*/ | |
function is_blank($value){ | |
return empty($value) && !is_numeric($value); | |
} | |
//is_blank(0); //false | |
//is_blank(''); //true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment