If I have an object as such:
class Person { var $age; function __construct($age) { $this->age = $age; } }
and I have any array
Try usort: http://www.php.net/manual/en/function.usort.php
Example:
sortField; $b = $objb->sortField; if ($a == $b) { return 0; } return ($a < $b) ? -1 : 1; } $a = array( /* your objects */ ); usort($a, "cmp"); ?>