Created
June 23, 2015 08:24
-
-
Save efenacigiray/7d61f279a6ac69f7715f to your computer and use it in GitHub Desktop.
php Array usort
This file contains hidden or 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
$array = array( | |
array('key' => 'key', 'value' => 1), | |
array('key' => 'bey', 'value' => 1), | |
array('key' => 'zey', 'value' => 1), | |
array('key' => 'aey', 'value' => 1) | |
); | |
uasort($array, | |
function($a, $b) | |
{ | |
return strcmp($a['key'], $b['key']); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment