So i've been looking throughout Stack Overflow looking for a solution for this problem. I have a multidimensional, non associative array in php and i want to sort it by one of its values, while maintaining the rest of the values within the same child array.
In the next example i want to sort the array by $fruits[This value][0].
This is what i have:
$fruits = array
(
array(2, apple),
array(1, orange),
array(4, banana),
array(3, kiwi),
);
This is what im looking for:
$fruits = array
(
array(1, orange),
array(2, apple),
array(3, kiwi),
array(4, banana),
);
This is what i dont want:
$fruits = array
(
array(1, apple),
array(2, orange),
array(3, banana),
array(4, kiwi),
);