$data = array(
array('country'=>'Spain', 'language'=>'Spanish', 'visitors'=>1289),
array('country'=>'France', 'language'=>'French', 'visitors'=>984),
array('country'=>'Argentina', 'language'=>'Spanish', 'visitors'=>812)
);
printf("%s
\n", var_export($data, TRUE));
$cols = array();
foreach($data as $row) {
foreach($row as $key => $value) {
if( !isset($cols[$key]) )
$cols[$key] = array();
$cols[$key][] = $value;
}
}
$data = $cols;
array_multisort($data['language'], $data['country'], $data['visitors']);
printf("%s
\n", var_export($data, TRUE));
?>