AWeber Api用户问题

我在使用PHP的AWeber的Api中遇到问题, 看下面的代码:
$email = 'soeemail@somesite.com';
foreach($account->lists as $offset => $list) {
    $subscriber = $account->loadFromUrl("/accounts/$account->id/lists/$list->id/subscribers?ws.op=find&email=$email");
    echo $subscriber->id;
    break;
}
问题是$ subscriber变量包含订阅者信息,当我使用print_r()或var_dump()时,它显示了它的内容,但是当我尝试使用echo或任何打印函数打印订阅者的id或其他任何内容时,它没有显示! 请快点帮帮我,我不知道如何解决这个问题。 谢谢 编辑:
$subscriber
var_dump()
object(AWeberCollection)#25 (8) { 
    ["pageSize:protected"]=> int(100) 
    ["_entries:protected"]=> array(0) { } 
    ["_privateData:protected"]=> array(3) { 
        [0]=> string(7) "entries" 
        [1]=> string(5) "start" 
        [2]=> string(20) "next_collection_link" 
    } 
    ["_iterationKey:protected"]=> int(0) 
    ["adapter"]=> object(OAuthApplication)#3 (10) { 
        ["debug"]=> bool(false) 
        ["userAgent"]=> string(64) "AWeber OAuth Consumer Application 1.0 - https://labs.aweber.com/" 
        ["format"]=> bool(false) 
        ["requiresTokenSecret"]=> bool(true) 
        ["signatureMethod"]=> string(9) "HMAC-SHA1" 
        ["version"]=> string(3) "1.0" 
        ["user"]=> object(OAuthUser)#5 (5) { 
            ["authorizedToken"]=> bool(false) 
            ["requestToken"]=> bool(false) 
            ["verifier"]=> bool(false) 
            ["tokenSecret"]=> string(40) "******" 
            ["accessToken"]=> string(24) "******" 
        } 
        ["consumerKey"]=> string(24) "******" 
        ["consumerSecret"]=> string(40) "******" 
        ["app"]=> object(AWeberServiceProvider)#2 (4) { 
            ["baseUri"]=> string(26) "https://api.aweber.com/1.0" 
            ["accessTokenUrl"]=> string(46) "https://auth.aweber.com/1.0/oauth/access_token" 
            ["authorizeUrl"]=> string(43) "https://auth.aweber.com/1.0/oauth/authorize" 
            ["requestTokenUrl"]=> string(47) "https://auth.aweber.com/1.0/oauth/request_token" 
        } 
    } 
    ["data"]=> array(3) { 
        ["start"]=> int(0) 
        ["total_size_link"]=> string(123) "http://api.aweber.com/1.0/accounts/******/lists/******/subscribers?email=******@******.com&ws.op=find&ws.show=total_size" 
        ["entries"]=> array(1) { 
            [0]=> array(29) { 
                ["subscription_url"]=> string(22) "http://******.com/" 
                ["postal_code"]=> string(5) "00000" 
                ["id"]=> int(******) 
                ["custom_fields"]=> array(0) { } 
                ["last_followup_sent_link"]=> string(74) "https://api.aweber.com/1.0/accounts/******/lists/******/campaigns/f*******" 
                ["city"]=> string(8) "Non" 
                ["http_etag"]=> string(83) ""******************"" 
                ["ad_tracking"]=> string(0) "" 
                ["dma_code"]=> int(******) 
                ["last_followup_message_number_sent"]=> int(1) 
                ["last_followup_sent_at"]=> string(32) "2011-05-08 14:26:15.099159-04:00" 
                ["misc_notes"]=> string(0) "" 
                ["latitude"]=> float(******) 
                ["is_verified"]=> bool(true) 
                ["email"]=> string(18) "******@******.com" 
                ["status"]=> string(10) "subscribed" 
                ["area_code"]=> int(818) 
                ["unsubscribed_at"]=> NULL 
                ["self_link"]=> string(76) "https://api.aweber.com/1.0/accounts/******/lists/******/subscribers/******" 
                ["unsubscribe_method"]=> NULL 
                ["ip_address"]=> string(12) "******" 
                ["name"]=> string(0) "" 
                ["subscription_method"]=> string(11) "signup form" 
                ["resource_type_link"]=> string(38) "https://api.aweber.com/1.0/#subscriber" 
                ["region"]=> string(2) "CA" 
                ["longitude"]=> float(-118.5752) 
                ["verified_at"]=> string(26) "2011-05-11 14:26:15.099159" 
                ["subscribed_at"]=> string(25) "2011-05-011 23:32:39-04:00" 
                ["country"]=> string(13) "United States" 
            } 
        } 
    } 
    ["_dynamicData"]=> array(0) { } 
    ["url"]=> string(77) "/accounts/******/lists/******/subscribers?ws.op=find&email=******@******.com" 
}
    
已邀请:
正如你在
var_dump
'ed对象中看到的那样,对象的第一级没有
id
键,所以
$subscriber->id
不是获得该ID的有效方法。
id
data / entries / 0
所以你可以访问
id
$subscriber->data['entries'][0]['id']
    

要回复问题请先登录注册