Posted By

tasmanweb on 03/16/13


Tagged


Versions (?)

is_empty() : safely test for an empty string (or mixed variable)


 / Published in: PHP
 

a function to safely test for an empty string (or mixed variable) in cases when "0" is not intended to be empty

  1. function _empty($string){
  2. $string = trim($string);
  3. if(!is_numeric($string)) return empty($string);
  4. return FALSE;
  5. }

Report this snippet  

You need to login to post a comment.