what i am looking for is a fast way to search up anything from these and get all fields back, for example if i search the sample code (given below) for "red" in favcolors, i get back name of the person whose kid's fave color this is, i.e. in this case, return an array containing jhon and homer. if the search term is for people with age = 43 then return homer, and so on...:
<?php
class person {
public $name;
public $kidsfavcolors=array();
public $age;
}
$people['jhon'] = new person;
$people['jhon']->name = "jhon";
$people['jhon']->age = 30;
$people['jhon']->kidsfavcolors['katherine']= "red";
$people['jhon']->kidsfavcolors['jimmy']= "yellow";
$people['homer'] = new person;
$people['homer']->name = "homer";
$people['homer']->age = 43;
$people['homer']->kidsfavcolors['bart']= "black";
$people['homer']->kidsfavcolors['lisa']= "red";