<?
$array = array(
'note' => array('test', 'test1', 'test2', 'test3', 'test4'),
'year' => array('2011','2010', '2012', '2009', '2010'),
'type' => array('conference', 'journal', 'conference', 'conference','conference'),
);
// Storing the original keys
$original_keys = array_keys($array);
$temp_array = array();
// Restructuring the array for sorting
foreach($array as $items){
$index = 0;
foreach($items as $item){
$temp_array[$index++][] = $item;
}
}
array_multisort($array['type'], SORT_ASC, SORT_STRING, $array['year'], SORT_DESC, $temp_array);
// Restoring the temp array in original format
$array = array();
foreach($temp_array as $items){
$index = 0;
foreach($original_keys as $key){
$array[$key][] = $items[$index++];
}
}
print_r($array);