php - Sort array by value then key -


this question has answer here:

i'm using asort sort simple array:

$arr = array('a'=>30, 'b'=>12, 'k'=>23, 'x'=>1, 'h'=>11, 't'=>1, 'u'=1);  asort($arr) 

yields

array (     [a] => 30     [k] => 23     [b] => 12     [h] => 11     [x] => 1     [t] => 1     [z] => 1 ) 

is there native way sort value and key in 1 call (while preserving key/value relationship)?

for example, i'm wanting results end this:

array (     [a] => 30     [k] => 23     [b] => 12     [h] => 11     [t] => 1     [x] => 1     [z] => 1 ) 

native function not, there ways easily

php array multiple sort - value key?


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -