Take this array as an example
Array
(
[events] => Array
(
[0] => Array
(
[event] => Array
(
[category] => seminars,sales
[status] => Live
How do I retrieve the value of category? I've tried various combinations such;
echo $array->events->events[0]->event->category;
So simple, yet I just can't figure it out.
Sorry for the lame question.
It should be
echo $array['events'][0]['event']['category'];
You are using the object property selector.
Try this:
echo $array['events'][0]['event']['category'] ;
Try echo $array['events'][0]['event']['category'];
Like this:
echo $arr['events'][0]['event']['category'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With