diff --git a/reference/array/functions/array-multisort.xml b/reference/array/functions/array-multisort.xml index 0af7372b93..7e04cfeeba 100644 --- a/reference/array/functions/array-multisort.xml +++ b/reference/array/functions/array-multisort.xml @@ -295,6 +295,10 @@ foreach ($data as $key => $row) { $edition[$key] = $row['edition']; } +// as of PHP 5.5.0 you can use array_column() instead of the above code +$volume = array_column($data, 'volume'); +$edition = array_column($data, 'edition'); + // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key array_multisort($volume, SORT_DESC, $edition, SORT_ASC, $data);