Created
July 30, 2012 15:39
-
-
Save Simounet/3207897 to your computer and use it in GitHub Desktop.
subval array sort function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function subval_sort($array, $subkey) { | |
foreach($array as $key => $value) { | |
$new_array[$key] = strtolower($value[$subkey]); | |
} | |
asort($new_array); | |
foreach($new_array as $new_key => $new_val) { | |
$result[$new_key] = $array[$new_key]; | |
} | |
return $result; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment