Reply to Re: sorting array...i

Your name:

Reply:


Posted by Rik Wasmus on 11/20/07 16:50

On Tue, 20 Nov 2007 16:32:13 +0100, VooDoo <VooDooNet38@free.fr> wrote:

> Hi,
> I am getting confused with sorting arrays...
> $arraytest =3Darray(5) { [0]=3D> string(2) "39" [1]=3D> string(2) "44"=
[2]=3D>
> string(2) "77" [3]=3D> string(3) "150" [4]=3D> string(3) "464" }
>
> why do i get NULL value if i try to sort this array using sort command=
?
>
> sort($arraytest);

Probably, because sort() works by reference, not return:

$arraytest =3D sort($arraytest);
//=3D>$arraytest =3D true or false; $arraytest[N] =3D NULL

sort($arraytest);
//=3D>$arraytest =3D sorted array; $arraytest[N] =3D set value or NULL i=
f =

non-existant
-- =

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

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