- uasort: documentation ( source)
- print_r: documentation ( source)
<?php
$Results = array(
"Matchings" => array(
array("Quotient"=>0.5)
)
);
echo "<pre>".print_r($Results, true)."</pre>";
$Results["Matchings"] = uasort($Results["Matchings"], function($a, $b){
echo "<pre>".print_r(array($a, $b), true)."</pre>";
if($a["Quotient"] == $b["Quotient"])
{
return 0;
}
return ($a["Quotient"] > $b["Quotient"] ? 1 : -1);
});
die("<pre>".print_r($Results, true)."</pre>");