[php]//------------------------------------------------//
// How to test for empty strings in PHP
//------------------------------------------------//
// http://www.texelate.co.uk/blog/how-to-test-for-empty-strings-in-php/
function strictEmpty($var) {
// Delete this line if you want space(s) to count as not empty
$var = trim($var);
if(isset($var) === true && $var !== '') {
// It's empty
}
else {
// It's not empty
}
}[/php]
Revisions
- March 15, 2015 @ 13:18:18 [Current Revision] by PeterLugg
- March 15, 2015 @ 13:18:18 by PeterLugg
Revision Differences
There are no differences between the March 15, 2015 @ 13:18:18 revision and the current revision. (Maybe only post meta information was changed.)
No comments yet.