<html>
<body>
function my_sort($a,$b)
{
if ($a==$b) return 0;
return ($a<$b)?-1:1;
}
$arr=array("a"=>4,"b"=>2,"c"=>8,"d"=>6);
uksort($arr,"my_sort");
foreach($arr as $x=>$x_value)
{
echo "Key=" . $x . ", Value=" . $x_value;
echo "<br>";
}
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_uksort by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:50:58 GMT -->
</html>