I have some multidimensional arrays like this (I trimmed sub-array values in this example):
Array (
[name] => This is my array name,
[0] => Array ( [id] => 9, [multiply] => 2, [name] => Item name ),
[1] => Array ( [id] => 24, [multiply] => 1, [name] => Another name,
[sub-array] => Array(has more data here..)
)
)
I'd like to sort only the numbered keys by the [multiply] field DESCENDING, the [name] array needs to stay at the beginning.
I've tried using usort(), but I need the [name] key to stay as it is.
Any hint what php-function could help me sort my multidimensional arrays?
array_map()
for that. – bad_boy Feb 22 at 13:21