I did look at usort, but am still a little confused...
Here is what the $myobject object looks like:
Array
(
[0] => stdClass Object
(
[tid] => 13
[vid] => 4
)
[1] => stdClass Object
(
[tid] => 10
[vid] => 4
)
[2] => stdClass Object
(
[tid] => 34
[vid] => 4
)
[3] => stdClass Object
(
[tid] => 9
[vid] => 4
)
I saw this:
function cmp( $a, $b )
{
if( $a->weight == $b->weight ){ return 0 ; }
return ($a->weight < $b->weight) ? -1 : 1;
}
usort($myobject,'cmp');
I'm trying to sort according to tid, but, I guess I'm just not sure really if I have to change weight to something? Or will it just work as is? I tried it, but nothing outputted...