I've got the following JSON:
{
"row": [
{
"sort":3,
"type":"fat",
"widgets":
[
{"values": [3,9] },
{"values": [8,4] }
]
},
{
"sort":2,
"type":"three",
"widgets":
[
{"values": [3,4] },
{"values": [12,7] },
{"values": [12,7] }
]
}
]
}
And this PHP to output it:
foreach ( $value->row as $therow )
{
echo "<div class='row ".$therow->type."'>";
foreach ( $therow->widgets as $thewidgets )
{
echo "<div class='widget'>";
echo $thewidgets->values[0];
echo "</div>";
}
echo "</div>";
}
What I would like to do is sort the ouput based on the sort value in the JSON, any ideas?