Possible Duplicate:
Sort array of objects
sort an object array in php
EDIT: This is a duplicate question. Just close this
I have an array of objects stored into $articles, and they don't necessarily come back in any particular order. I'm trying to sort the objects based on the idarticles. I know how to do this in javascript, but no idea how to do it in PHP. Here is a sample response. I echo'd it out with json_encode for readability. Any help would be great
[
{
"idarticles":"61",
"full_text":"",
"main_image":"",
"tags":null,
"url":null,
"summary":null,
"title":"No Title Given"
},
{
"idarticles":"64",
"full_text":"",
"main_image":"http:\/\/i2.cdn.turner.com\/cnn\/dam\/assets\/121014085050-11-stratos-1014-horizontal-gallery.jpg",
"tags":"Sound,New Mexico,Maxima and minima",
"url":"some string",
"summary":"text",
"title":"text"
},
{
"idarticles":"63",
"full_text":"",
"main_image":"http:\/\/i2.cdn.turner.com\/cnn\/dam\/assets\/121014085050-11-stratos-1014-horizontal-gallery.jpg",
"tags":"Sound,New Mexico,Maxima and minima",
"url":"some string",
"summary":"text",
"title":"text"
}
]