Re: the usort 's puzzle
- From: Michael Fesser <netizen@xxxxxx>
- Date: Sun, 30 Sep 2007 06:18:04 +0200
..oO(youngord@xxxxxxxxx)
<?php
$mix=array(
array("A",10),
array("B",5),
array("C",100)
);
function com($x,$y){
echo $x[0];
}
usort($mix,'com');
?>
i think the $x[0] result is A,
but the final $x[0] result is BC.
why???
What are you trying to do? The above doesn't really makes sense.
The result depends on what sorting algorithm PHP uses internally.
Micha
.
- References:
- the usort 's puzzle
- From: youngord
- the usort 's puzzle
- Prev by Date: the usort 's puzzle
- Next by Date: Re: Site preview with thumb
- Previous by thread: the usort 's puzzle
- Next by thread: Re: the usort 's puzzle
- Index(es):