Query: collator_sort
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
COLLATOR_SORT(3) 1 COLLATOR_SORT(3) Collator::sort - Sort array using specified collator Object oriented styleSYNOPSISpublic bool Collator::sort (array &$arr, [int $sort_flag])DESCRIPTIONProcedural style bool collator_sort (Collator $coll, array &$arr, [int $sort_flag]) This function sorts an array according to current locale rules. Equivalent to standard PHP sort(3) .PARAMETERSo $coll -Collator object. o $arr - Array of strings to sort. o $sort_flag - Optional sorting type, one of the following: o Collator::SORT_REGULAR - compare items normally (don't change types) o Collator::SORT_NUMERIC - compare items numerically o Collator::SORT_STRING - compare items as strings Default sorting type is Collator::SORT_REGULAR. It is also used if an invalid $sort_flag value has been specified.RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #1 collator_sort(3) example <?php $coll = collator_create( 'en_US' ); $arr = array( 'at', 'as', 'as' ); var_export( $arr ); collator_sort( $coll, $arr ); var_export( $arr ); ?> The above example will output: array ( 0 => 'at', 1 => 'as', 2 => 'as', )array ( 0 => 'as', 1 => 'as', 2 => 'at', )SEE ALSOCollator constants, collator_asort(3), collator_sort_with_sort_keys(3). PHP Documentation Group COLLATOR_SORT(3)
Related Man Pages |
---|
collator(3) - php |
array_unique(3) - php |
collator_asort(3) - php |
collator_get_locale(3) - php |
perl::critic::policy::variables::requirenegativeindices(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
Why do we use sort before compare ? |
sort -M |
Integer array length |
Multidimensional array:awk error |
Array length: ls and sort |