title: Remove empty elements from associative array selectively in PHP
body: <p>I have the following associative array:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; 18-Jul-16
              [1] =&gt; 29-Jul-15
              [2] =&gt; 2-Feb-16
              [3] =&gt; 3301
              [4] =&gt; 1800 Bimodel
              [5] =&gt; 5813
              [6] =&gt; 1 800 Bimodel Multi-Option Test
              [7] =&gt; Tested
              [8] =&gt; Shop Center
              [9] =&gt; Shop Services
              [10] =&gt; 864
              [11] =&gt; 20
              [12] =&gt; 884
              [13] =&gt; 0.75
              [14] =&gt; 0.2
              [15] =&gt; 0.49
              [16] =&gt; 429.6
              [17] =&gt; 47.3
              [18] =&gt; 382.3
              [19] =&gt; 
              [20] =&gt; Jonas John
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; 
              [1] =&gt; 
              [2] =&gt; 
              [3] =&gt; 
              [4] =&gt; 
              [5] =&gt; 
              [6] =&gt; 
              [7] =&gt; 
              [8] =&gt; 
              [9] =&gt; 
              [10] =&gt; 
              [11] =&gt; 
              [12] =&gt; 
              [13] =&gt; 
              [14] =&gt; 
              [15] =&gt; 
              [16] =&gt; 
              [17] =&gt; 
              [18] =&gt; 
              [19] =&gt; 
              [20] =&gt; 
          )
  )
  </code></pre>
  
  <p>To filter out the empty array elements, I am using the following code:</p>
  
  <pre><code>            $arrData = array_map('array_filter', $arrData);
              $arrData = array_filter($arrData);
  </code></pre>
  
  <p>The above code removes all empty elements from the array. It also removes value at index 19 in the 0th array. I want it to remove array elements only if all the values of the array are empty. In my case only array at index 1 should be removed and the array at 0th index should not be removed (or any of its elements). I will always need 21 elements from each array. Can I do that selectively using php code ?</p>
  
  <p>Thanks</p>