View Single Post

  #2 (permalink)  
Old 06-03-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: sort array by key

Boefje wrote:
> I have looked at the sort functions at PHP.net, but could not find the
> solution.
>


You have missed usort():

function cmp($a, $b) {
if ($a['speeldagvolgnr'] == $b['speeldagvolgnr']) {
return 0;
}
return ($a['speeldagvolgnr'] < $b['speeldagvolgnr']) ? -1 : 1;
}

usort($matches, "cmp");


JW



Reply With Quote