Hi,
I am trying to sort a multi-dimensional array.
The array is set up in such a way that the indexes are not consistent. For example:
I am trying to sort this array based on the value. I created a custom comparison function to use with usort(). It is below:
Then in the code, I call:
The usort function, when comparing, seems to want to loop through all possible indexes.
That is, it will compare $the_array[0]["value"] even though it does not exist there is no index 0.
This is the observation I have made.
Any ideas of how to modify the function, or use something besides usort to accomplish the sorting on only the available indexes?
Thanks in advance!