Yes, I have searched and tried many techniques, but nothing seems to work. Here is my array:
Array
(
[0] => stdClass Object
(
[id]
You should use usort...
So you define a function that compares two objects (by the name field) and then run usort on the array, passing in the function as the second argument.
Something like this:
function cmp($a, $b)
{
if ($a["name"] == $b["name"]) {
return 0;
}
return ($a["name"] < $b["name"]) ? -1 : 1;
}
usort ($my_array, "cmp");
var_dump($my_array);
Hope that helps!
Ben