|
Posted by Rik Wasmus on 09/30/07 12:46
On Sun, 30 Sep 2007 05:37:16 +0200, <youngord@gmail.com> wrote:
> <?php
> $mix=3Darray(
> 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???
Because PHP uses an internal construct to sort, starting whereever it's =
=
internal functionality is written to start, which should not matter. If =
it =
compares (B,A) & (C,B), it knows enough to sort.
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|