| License | GPL |
| Author | Thierry Graff |
| History | 2007.10.25, 21h58 : Creation |
| License | GPL |
| Author | Thierry Graff |
| History | 2007.10.25, 21h58 : Creation |
| - $sortByKey_keyname | Auxiliary variable of sortByKey(), for usort() |
| + explode() | Same as php function explode(), but each entry of the result is trimmed, and empty strings are not in the resulting array |
| + natcaseasort() | Like php function natcasesort(), but maintains key-values associations (sorts by values) |
| + natcaseksort() | Like php function natcasesort(), but sorts by keys and maintains key-values associations |
| + sortByKey() | Sorts a 2 dim array, using one of the key of its elements to sort. |
| - sortByKey_aux() | Auxiliary function of sortByKey(), for usort() |
private static $sortByKey_keynameAuxiliary variable of sortByKey(), for usort().
public static function explode( |
$delimiter)
|
$delimiter |
|
$string |
|
$limit |
public static function natcaseasort( |
&$array)
|
$array |
The array to sort |
public static function natcaseksort( |
&$array)
|
$array |
The array to sort |
public static function sortByKey( |
$array)
|
$array = array(
0=>array('name'=>'toto', 'age'=>45),
1=>array('name'=>'titi', 'age'=>25),
2=>array('name'=>'tata', 'age'=>35)
);
UArrays::sortByKey($array, 'name')
$array is now :
array(
0=>array('name'=>'tata', 'age'=>35),
1=>array('name'=>'titi', 'age'=>25),
2=>array('name'=>'toto', 'age'=>45)
);
$array |
Array to sort |
$keyname |
Name of the key used to sort |
private static function sortByKey_aux( |
$a)
|