 <pre><code>$array = [1, 6, 2]; array_unshift($array, array_pop($array)); </code></pre> <p>Or possibly:</p> <pre><code>$array = [1, 6, 2]; $tmp = array_splice($array, 2, 1); array_unshift($array, $tmp[0]); </code></pre> <p>You're not really looking for <em>sorting on values</em>, you just want to swap indices.<br> If you want to insert the value somewhere other than the front of the array, splice it back in with <a href="http://php.net/array_splice" rel="nofollow"><code>array_splice</code></a>.</p> <p>If you have more keys that you need to change around, then sorting may after all become the simplest solution:</p> <pre><code>uksort($array, function ($a, $b) { static $keyOrder = [2 =&gt; 0, 0 =&gt; 1, 1 =&gt; 2]; return $keyOrder[$b] - $keyOrder[$a]; }); </code></pre>