title: Filter recursive array and only remove NULL value
body: <p>I want to remove all null or blank value but not false and 0 value from recursive array.</p>
  
  <pre><code>function isNotNull($val) {
      if(is_array($val)) {
          $ret = array_filter($val, 'isNotNull');
          return $ret;
      } else {
          return (!is_null($val) &amp;&amp; $val !== '');
     }
  
  }
  </code></pre>
  
  <p>$arr = array_filter($arr, 'isNotNull');</p>
  
  <p>Input:</p>
  
  <pre><code>$arr = array(
  "stringKey" =&gt; "Abc",
  "boolKey" =&gt; false,
  "zeroKey" =&gt; 0,
  "blankKey" =&gt; '',
  "newArr" =&gt; array(
      "stringKey2"=&gt;"Abc2", 
      "boolKey2"=&gt;false, 
      "zeroKey2" =&gt; 0, 
      "blankKey2"=&gt;"", 
      "blankArr" =&gt; array()
      )
  );
  </code></pre>
  
  <p>This give output:</p>
  
  <pre><code>Array
  (
      [stringKey] =&gt; Abc
      [boolKey] =&gt; 
      [zeroKey] =&gt; 0
      [newArr] =&gt; Array
          (
              [stringKey2] =&gt; Abc2
              [boolKey2] =&gt; 
              [zeroKey2] =&gt; 0
              [blankKey2] =&gt; 
              [blankArr] =&gt; Array
                  (
                  )
          )
  )
  </code></pre>
  
  <p>But i want to bellow output:</p>
  
  <pre><code> Array
  (
      [stringKey] =&gt; Abc
      [boolKey] =&gt; 
      [zeroKey] =&gt; 0
      [newArr] =&gt; Array
          (
              [stringKey2] =&gt; Abc2
              [boolKey2] =&gt; 
              [zeroKey2] =&gt; 0
          )
  )
  </code></pre>
  
  <p>I used array_filter with callback function but it only filter simple array not multidimensional array. I don't want to use loop. </p>