title: PHP - How to move the empty values of an array to its last positions
body: <p>How can I move the empty values of an array to its last position? </p>
  
  <p>For example:</p>
  
  <pre><code>$givenArray = array( 
                      0=&gt;'green', 
                      1=&gt;'', 
                      2=&gt;'red', 
                      3=&gt;'', 
                      4=&gt;'blue'
                    );
  
  $requiredArray = array(
                         0=&gt;'green',
                         1=&gt;'red',
                         2=&gt;'blue',
                         3=&gt;'',
                         4=&gt;'' 
                        );
  </code></pre>
  
  <p>Provided that the non empty values should not be sorted. It should be as it is, i.e. only the empty values should move to the end of an array. </p>
  
  <p>I need exactly what my examples show.</p>