Re: sorting multi-array

From: Date: Thu, 24 Jul 2003 14:50:46 +0000
Subject: Re: sorting multi-array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156655@lists.php.net to get a copy of this message
www.php.net/usort - slight modification of the example (hint: add [0] to $a and $b). Jiří Němec wrote:
hello, i have got a problem, tehere is an array: $x = array( array(15,55,array(1,2,3),3,5,array(1,2,5)), array(25,55,array(1,2,3),3,5,array(1,2,5)), array(5,55,array(1,2,3),3,5,array(1,2,5)) ); and I need to sort this arraybz first item of sub-arrays (x[0][0], $x[1][0], $x[2][0]). this is the correct result: $x = array( array(5,55,array(1,2,3),3,5,array(1,2,5)), array(15,55,array(1,2,3),3,5,array(1,2,5)), array(25,55,array(1,2,3),3,5,array(1,2,5)) ); some idea how sort this multidimensional array? thank you for your reply. jiří němec, ICQ: 114651500 www.menea.cz - www stránky a aplikace


« previous php.general (#156655) next »