0

how would i go about extracting the data from the ["Actions"] array below:

array(3) { [0]=> object(stdClass)#5 (4) { ["ID"]=> string(32) "xxxxxxxxxxxxxxxxx" ["Type"]=> string(8) "Campaign" ["Name"]=> string(28) "An unmissable invitation for" ["Actions"]=> array(1) { [0]=> object(stdClass)#6 (4) { ["Event"]=> string(4) "Open" ["Date"]=> string(19) "2013-04-30 19:01:00" ["IPAddress"]=> string(14) "xxx.xxx.xxx.xxx" ["Detail"]=> string(0) "" } } } 

i can extract anything above that array by doing the following:

foreach($result->response as $entry) { echo '<tr>'; echo '<td>'.$entry->ID.'</td>'; echo '<td>'.$entry->Type.'</td>'; echo '<td>'.$entry->Name.'</td>'; echo '<td>'.$entry->Actions["Event"][0].'</td>'; echo '</tr>'; } 
3
  • use the $entry->Actions[0]["Event"] to get data from action array. Commented Jul 10, 2013 at 10:57
  • i have stied this and get Fatal error: Cannot use object of type stdClass as array Commented Jul 10, 2013 at 10:59
  • 1
    getting your point here you should use the $entry->Actions[0]->Event. Commented Jul 10, 2013 at 11:01

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.