I have the following objects with arrays and trying to get the value of email. How can this be done?
stdClass Object (
[status] => stdClass Object (
[info] => Unsubscribe List [code] => 200
)
[data] => Array (
[[email protected]] => stdClass Object (
[date] => 2013-01-28 08:09:19
[origin] =>
)
[[email protected]] => stdClass Object (
[date] => 2013-01-28 08:35:59
[origin] =>
)
)
)
Currently i can access the date values with the following foreach.
foreach ($fnret->data as $msg) {
echo $msg->date; // shows 2013-01-28 08:35:59
}
foreach ($array as $key => $value)
is the answer. The$key
holds value of what is in[]
brackets.[key] => value
– Qwerty Mar 1 '13 at 10:07