php - extract string from object array -


i have following php:

$getlists = new cs_rest_campaigns($_post['campaign_id'], $auth); $getlistsresult = $wrap->get_lists_and_segments();  if($getlistsresult->was_successful()) {     echo '<pre>';     var_dump($getlistsresult->response);     echo '</pre>'; } 

the above outputs:

 object(stdclass)#310 (2) {   ["lists"]=>   array(1) {     [0]=>     object(stdclass)#309 (2) {       ["listid"]=>       string(32) "xxxxxxxxxxxxxxxxxxxxxx"       ["name"]=>       string(6) "list 1"     }   }   ["segments"]=>   array(0) {   } } 

how target / extract listid?

i have tried following doesnt return anything:

foreach($getlistsresult->response->results $entry) {     echo $entry->listid; } 

looks there's mistake in foreach:

foreach($getlistsresult->response->lists $entry) {     echo $entry->listid; } 

Comments