Re: Arrays?

From: Date: Mon, 08 Jan 2007 09:05:52 +0000
Subject: Re: Arrays?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-246740@lists.php.net to get a copy of this message
Nicholas Yim wrote: > Hello William Stokes, > > 1 write a callback function: > [php] > function cmp_forth_value($left,$right){ > return $left[4]<$right?-1:($left[4]==$right[4]?0:1); return $left[4]<$right[4]?-1:($left[4]==$right[4]?0:1); ^^^ add this > } > [/php] > > 2 use the usort function > > usort($test,'cmp_forth_value'); > > Best regards, -- Thanking You Sumeet Shroff http://www.prateeksha.com Web Designers and PHP / Mysql Ecommerce Development, Mumbai India

« previous php.general (#246740) next »