I have three arrays that I want to print out with a nice sorting.
$person[]->name ('Foo','Bar','Foooo')
$person[]->sold ('10000','123123','234234')
$person[]->comment ('asd','qwer','zxcv')
Now I print out every array like this:
$total = 3;
$x = 0;
while($x<$total)
{
echo $person[$x]->name;
echo $person[$x]->sold;
echo $person[$x]->comment;
$x++;
}
This returns the content of the arrays. Actually I print out this in a table, but that doesn't make any difference.
My question is if it's possible to print out the arrays and order by $person->sold for example? If yes - how?
Many thanks!
$arrperson = get_object_vars($person); array_unshift($arrperson, NULL); $easierperson = call_user_func_array('array_map',$arrperson);Then it's just an usort.