title: PHP Recursive Function, return error
body: <p>I create a PHP function to test if <code>$var exist and is not empty</code>.</p>
  
  <p>But, But I have a problem that I can't identify :</p>
  
  <ul>
  <li>In my foreach, return false is ignored because another 'return' return first.</li>
  </ul>
  
  <p>LOOK : </p>
  
  <pre><code>    function notEmpty($var, $r=false){
      if(gettype($var)=='string' OR gettype($var)=='integer'){
          if($r==false){
              if(isset($var) AND @!empty($var)){
                  return true;
              }else{return false;}
          }else{
              if(!isset($var) AND @empty($var)){
                  return false;
              }
          }
      }elseif(gettype($var)=='array'){
          foreach($var as $val){
              if(gettype($val)=='array'){
                  notEmpty($val, true);
              }else{
                  if(empty($val) OR $val==''){echo "string";
                      return false;
                  }
              }
          }
          return true;
      }else{return null;}
  }
  </code></pre>
  
  <p>I call my function like : 
  - <code>notEmpty(array($val1, $val2, $val3));</code></p>