我有以下 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>';
}
上述输出:
object(stdClass)#310 (2) {
["Lists"]=>
array(1) {
[0]=>
object(stdClass)#309 (2) {
["ListID"]=>
string(32) "xxxxxxxxxxxxxxxxxxxxxx"
["Name"]=>
string(6) "List 1"
}
}
["Segments"]=>
array(0) {
}
}
我将如何定位/提取 ListID?
我尝试了以下不返回任何内容的方法:
foreach($getlistsresult->response->Results as $entry) {
echo $entry->ListID;
}