php: how to sort user array with ids in correct order : <p>I am stuck with this, and I can't figure out the solution.</p>

<p>I have 2 arrays:</p>

<pre><code>$user_names = array();
$user_ids = array();
</code></pre>

<p>Which look like this</p>

<pre><code>Array
(
    [0] =&gt; John
    [1] =&gt; Peter
    [2] =&gt; Anna
)

Array
(
    [0] =&gt; 67
    [1] =&gt; 68
    [2] =&gt; 73
)
</code></pre>

<p>I wanted to sort this array by $user_names with <strong>sort($user_names)</strong> but when I sort the user names then my user_ids are not matching up..</p>

<p>So if I wanted to print "User: John with id: X" after sorting user_names my ids don't match. I am dead stuck with this...</p>
