PHP - Remove duplicates from an array, then remove nulls, then restructure
<p>I have an array (sizeofarray = 5)</p>

<pre><code>$city[0] = 'Newyork'
$city[1] = 'Paris'
$city[2] = 'Paris'
$city[3] = 'Newyork'
$city[4] = 'Amsterdam'
(sizeofarray = 5)
</code></pre>

<p>I used array_unique() to remove dupes and got this:</p>

<pre><code>$city[0] = 'Newyork'
$city[1] = 'Paris'
$city[4] = 'Amsterdam'
(sizeofarray = 3)
</code></pre>

<p>But now I want this:</p>

<pre><code>$city[0] = 'Newyork'
$city[1] = 'Paris'
$city[2] = 'Amsterdam'
(sizeofarray = 3)
</code></pre>

<p>Is there some function to achieve this?</p>

<p><strong>EDITED THE QUESTION</strong></p>
