I need to create an array of objects with properties, like this:
$var[0]->propA = “xyz”;
$var[0]->propB = “abc”;
$var[1]->propA = “123”;
$var[1]->propB = “098”;
How can I create this in a single statement? The following code does NOT work, but is the sort of thing I’m trying to do:
[php]
$var = Array(
new stdClass(
‘propA’ => ‘xyz’,
‘propB’ => ‘abc’
),
new stdClass(
‘propA’ => ‘123’,
‘propB’ => ‘098’
)
);
[/php]
Thanks for the advice!
Mike