I want to sort a multi-dimensional array in which each array is an object. The example at
http://php.net/manual/en/function.array-multisort.php
indicates the need to create an array of the columns on which to sort
foreach ($data as $key => $row) {
$volume[$key] = $row['volume'];
$edition[$key] = $row['edition'];
}
array_multisort($volume, SORT_DESC, $edition, SORT_ASC, $data);
but I get the followiwng error if I format my request in this format:
Catchable fatal error: Object of class stdClass could not be converted to string
Code is as follows with a key/value pair for last name with key last_name:
foreach ($mw_users as $key => $value) {
$last_name[$key] = $row['last_name'];
}
array_multisort($last_name, SORT_ASC, $mw_users);