这是我返回的对象的 print_r() :
Array
(
[0] => stdClass Object
(
[list_id] => 547009977
[list_name] => Master List
[list_type] => email
[member_data] => Array
(
[0] => stdClass Object
(
[name] => work_phone
[value] =>
)
[1] => stdClass Object
(
[name] => city
[value] =>
)
[2] => stdClass Object
(
[name] => restricted_since
[value] =>
)
[3] => stdClass Object
(
[name] => unsub_campaign_id
[value] =>
)
[4] => stdClass Object
(
[name] => title
[value] =>
)
[5] => stdClass Object
(
[name] => comments
[value] =>
)
[6] => stdClass Object
(
[name] => company_name
[value] =>
)
[7] => stdClass Object
(
[name] => Info
[value] =>
)
[8] => stdClass Object
(
[name] => address_hash
[value] =>
)
[9] => stdClass Object
(
[name] => hash
[value] => 2054ee9827
)
[10] => stdClass Object
(
[name] => country
[value] =>
)
[11] => stdClass Object
(
[name] => id
[value] => 45
)
[12] => stdClass Object
(
[name] => gender
[value] =>
)
[13] => stdClass Object
(
[name] => postalcode
[value] =>
)
[14] => stdClass Object
(
[name] => address_1
[value] =>
)
[15] => stdClass Object
(
[name] => create_date
[value] => 2013-07-15T15:31:35+00:00
)
[16] => stdClass Object
(
[name] => optin_status_last_updated
[value] => 2013-07-15T15:31:35+00:00
)
[17] => stdClass Object
(
[name] => Purchased
[value] =>
)
[18] => stdClass Object
(
[name] => marital_status
[value] =>
)
[19] => stdClass Object
(
[name] => optin_status
[value] => null
)
[20] => stdClass Object
(
[name] => last_updated
[value] => 2013-07-15T15:31:35+00:00
)
[21] => stdClass Object
(
[name] => address_2
[value] =>
)
[22] => stdClass Object
(
[name] => home_phone
[value] =>
)
[23] => stdClass Object
(
[name] => fax
[value] =>
)
[24] => stdClass Object
(
[name] => first_name
[value] => CoregTest
)
[25] => stdClass Object
(
[name] => bounce_campaign_id
[value] =>
)
[26] => stdClass Object
(
[name] => Page
[value] =>
)
[27] => stdClass Object
(
[name] => is_cass_certified
[value] => 0
)
[28] => stdClass Object
(
[name] => last_name
[value] =>
)
[29] => stdClass Object
(
[name] => restricted
[value] => 0
)
[30] => stdClass Object
(
[name] => mobile_phone
[value] =>
)
[31] => stdClass Object
(
[name] => email_address
[value] => coregtest@chrisjallen.com
)
[32] => stdClass Object
(
[name] => ip_address
[value] =>
)
[33] => stdClass Object
(
[name] => state
[value] =>
)
)
)
)
我要做的就是访问我的 php 代码中的 list_id 。如果我将它放入 $result 变量中:
$result = $vr->searchListMembers( array(
'session_id' => $sid,
'field_name' => 'email_address',
'field_value' => $email,
'max_records' => 1
) );
我试过了
$result->list_id
和
$result[0]['list_id']
这似乎很明显,但我在这里遗漏了一些东西。