stig1 Posted May 17, 2011 Share Posted May 17, 2011 I have the current data show up when I do a var_dump. Code $result = $wrap->get_lists(); echo "Result of lists:<br />"; if($result->was_successful()) { echo "Got lists\n<br /><pre>"; var_dump($result->response); //print_r($result->response); } else { echo 'Failed with code '.$result->http_status_code."\n<br /><pre>"; var_dump($result->response); } echo '</pre>'; Data Output array(303) { [0]=> object(stdClass)#5 (2) { ["ListID"]=> string(32) "df2d1497b0f4bdc3b8b77863f6721025" ["Name"]=> string(14) "DATA1" } [1]=> object(stdClass)#6 (2) { ["ListID"]=> string(32) "f44d9acf655e914b944d7174bdd521ff" ["Name"]=> string(14) "DATA2" } [2]=> object(stdClass)#7 (2) { ["ListID"]=> string(32) "c84f4ba6b86bc508e6922f4ca44ab41c" ["Name"]=> string(14) "DATA3" } [3]=> object(stdClass)#8 (2) { ["ListID"]=> string(32) "b7dc652cd5060194362f19667ddf47e9" ["Name"]=> string(14) "DATA4" } } What I need to achieve is get the data in "ListID" out so I can run "ListID" through another function of mine, to delete records. Any ideas, how I would get "ListID" values out of the array? Link to comment https://forums.phpfreaks.com/topic/236609-get-data-out-of-array/ Share on other sites More sharing options...
anupamsaha Posted May 17, 2011 Share Posted May 17, 2011 Try this: foreach($result->response as $response) { echo $response->ListID . "\n"; } Link to comment https://forums.phpfreaks.com/topic/236609-get-data-out-of-array/#findComment-1216368 Share on other sites More sharing options...
stig1 Posted May 17, 2011 Author Share Posted May 17, 2011 thank you for your assistance it works like a charm! Link to comment https://forums.phpfreaks.com/topic/236609-get-data-out-of-array/#findComment-1216369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.