[eluser]umbongo[/eluser]
How can i create an array of objects?
I am trying to get a result like..
Array ( [0] => stdClass Object ( [id] => 123 [name] => Name [color] => red... ) [1] => stdClass Object ( [id] => 124 ...
the following has not been working
Code:
$i=0;
foreach($hits as $hit){
$results[$i]->id= $hit->id;
$results[$i]->name=$hit->name;
$results[$i]->color=$hit->color;
$i++;
}
Sorry for the noob question i'm not to hot on objects etc.