Reply to Re: the usort 's puzzle

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация