I can't figure it out 🙁 I’ve been looking around for a function or some code I can understand to sort multidimensional arrays.
Say, for example, I have an array of arrays and want to sort them by the second item in each array (in the example below sort them by width).
the array has this format
Array(
array(“imageName”, width, height)
)
e.g.
Array(
array(“imageName1”, 70, 100)
array(“imageName2”, 210, 100)
array(“imageName3”, 30, 100)
array(“imageName4”, 40, 100)
)
I want to sort them by the secont item (width) so it turns out like this
Array(
array(“imageName3”, 30, 100)
array(“imageName4”, 40, 100)
array(“imageName1”, 70, 100)
array(“imageName2”, 210, 100)
)
I’ve been looking through this form and thought php.net’s functions and tried some of my own code but still can’t seem to get my head around how to get it working.
Can anyone help!!!
Thanks