downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<sortuksort>
Last updated: Thu, 26 Jun 2008

uasort

(PHP 4, PHP 5)

uasort — Sort an array with a user-defined comparison function and maintain index association

Description

bool uasort ( array &$array , callback $cmp_function )

This function sorts an array such that array indices maintain their correlation with the array elements they are associated with, using a user-defined comparison function.

This is used mainly when sorting associative arrays where the actual element order is significant.

Parameters

array

The input array.

cmp_function

See usort() and uksort() for examples of user-defined comparison functions.

Return Values

Returns TRUE on success or FALSE on failure.



add a noteadd a note User Contributed Notes
Sort an array with a user-defined comparison function and maintain index association
There are no user contributed notes for this page.




<sortuksort>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs