我有PHP数组,看起来像按订单
$my_arr['cats'] = array('Shadow', 'Tiger', 'Luna');
$my_arr['dogs'] = array('Buddy', 'Lucy', 'Bella');
$my_arr['dolphins'] = array('Sunny', 'Comet', 'Pumpkin');
$my_arr['lizzards'] = array('Apollo', 'Eddie', 'Bruce');
//and many more lines like this
我需要根据它的键使用排序数组一样
$order = array('lizzards', 'cats');
排序它,我想第一项目应该是lizzards数组,第二项 - 猫然后所有未在$ order数组中指定的项目。如何使用usort/uasort/uksort函数来完成?
您正在寻找多数组排序? http://php.net/manual/en/function.array-multisort.php – cosmoonot
不,我不需要排序内部阵列 – moonvader