Struggling with the basics here.
I want to setup an array, and fill it with multiple data objects, by looping through an array.
How do I add multiple $parent data objects that are unique, to the parentarray?
When I use the below the last one overwrites all the others. As simple as adding $parent[] or something like that?
Thanks,
$parentarray = array();
foreach ($otherarray as $bar) {
$parent = new stdClass;
$parent->conversion = $bar;
$parent->negative = $constant;
}
why not use
?