Re: Sorting an array
| From: | John Nichel | Date: | Wed, 02 Jun 2004 17:31:02 +0000 |
| Subject: | Re: Sorting an array | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187466@lists.php.net to get a copy of this message | ||
Robert Cummings wrote:
On Wed, 2004-06-02 at 12:59, John Nichel wrote:That did the trick. Thanks. -- John C. Nichel KegWorks.com 716.856.9675 john@kegworks.comWhat I would like to do is sort this on the value of 'sort' in each sub-array. What am I missing???? TIAusort( $theAboveArray, 'mySortHandler' ); function mySortHandler( $v1, $v2 ) {if( $v1['sort'] > $v2['sort'] ) { return 1; } else if( $v1['sort'] < $v2['sort'] ) { return -1; }return 0;} Cheers, Rob.