Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1.     function is_empty(&$input)
  2.     {
  3.         if(isset($input) && ($input != null)     // check to make sure not empty
  4.         && (is_array($input) && count($input) > 0) ||  // if array, make sure it has an element
  5.            (strlen(trim($input)) > 0) )          // if not array, it should have non zero length
  6.         {
  7.             return false;
  8.         }
  9.         else
  10.         {
  11.             return true;
  12.         }  
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement