title: PHP Array trim blank index values
body: <p>How to trim a PHP array and remove all empty indexes</p>
  
  <pre><code>Array
  (
      [0] =&gt; 
      [1] =&gt;
      [2] =&gt;
      [3] =&gt;
      [4] =&gt;
      [5] =&gt;
      [6] =&gt;
      [7] =&gt; 4
      [8] =&gt; 6
      [9] =&gt;
  
  )
  </code></pre>
  
  <p>Output should be like </p>
  
  <pre><code> Array
      (
          [0] =&gt; 4
          [1] =&gt; 6   
      )
  </code></pre>