title: how to reset array order after filtering in php
body: <pre><code>$p2 = array_filter($p);
  var_dump($p2);
  </code></pre>
  
  <p>I have a $p array which has <code>''</code> values. I have deleted them using <code>array_filter()</code> function. But I also want to re-order/reset indices. </p>
  
  <p><code>$p</code> array contents</p>
  
  <pre><code>  0 =&gt; string '' (length=0)
    1 =&gt; string '' (length=0)
    2 =&gt; string '' (length=0)
    3 =&gt; string '' (length=0)
    4 =&gt; string '' (length=0)
    5 =&gt; string '' (length=0)
    6 =&gt; string '' (length=0)
    7 =&gt; string '' (length=0)
    8 =&gt; string '123' (length=3)
    9 =&gt; string '20130' (length=5)
    10 =&gt; string '' (length=0)
  </code></pre>
  
  <p>After filtering the new array is as the following:</p>
  
  <p><code>$p2</code> array contents</p>
  
  <pre><code>  8 =&gt; string '123' (length=3)
    9 =&gt; string '20130' (length=5)
  </code></pre>
  
  <p>I want <code>$p2</code> </p>
  
  <pre><code>  0 =&gt; string '123' (length=3)
    1 =&gt; string '20130' (length=5)
  </code></pre>
  
  <p>Transferring elements to a new array would be a solution. I will go with that way if there is not faster method.</p>