0
listSubscriptions這個方法我已經得到了對象波紋管的這種格式後。任何人都可以幫助我如何從這個對象讀取標題和channelId?如何閱讀方法的結果:從Youtube PHP API
$subscriptionResponse = $youtube->subscriptions->listSubscriptions('snippet',
array('channelId' => 'MY_CHANEL_ID', 'maxResults' => '50'));
echo "<pre>";
print_r($subscriptionResponse['items']);
echo "</pre>";
die();
Array
(
[0] => Google_Service_YouTube_Subscription Object
(
[contentDetailsType:protected] => Google_Service_YouTube_SubscriptionContentDetails
[contentDetailsDataType:protected] =>
[etag] => "xxxxxxxxxxxxxxxxx"
[id] => xxxxxxxxxxxxxxxxx
[kind] => youtube#subscription
[snippetType:protected] => Google_Service_YouTube_SubscriptionSnippet
[snippetDataType:protected] =>
[subscriberSnippetType:protected] => Google_Service_YouTube_SubscriptionSubscriberSnippet
[subscriberSnippetDataType:protected] =>
[data:protected] => Array
(
[snippet] => Array
(
[publishedAt] => 2014-03-04T13:51:59.000Z
[title] => THIS IS THE CHANNEL TITLE THAT I WANT TO GET
[description] => xxxxxxxxxxxxxxxx
[resourceId] => Array
(
[kind] => youtube#channel
[channelId] => xxxxxxxxxxxxxxxxx
)
[channelId] => xxxxxxxxxxxxxxxxx
[thumbnails] => Array
(
[default] => Array
(
[url] => https://yt3.ggpht.com/-b1X29Q2BT6A/AAAAAAAAAAI/AAAAAAAAAAA/QdK_MNBrNRU/s88-c-k-no/photo.jpg
)
[high] => Array
(
[url] => https://yt3.ggpht.com/-b1X29Q2BT6A/AAAAAAAAAAI/AAAAAAAAAAA/QdK_MNBrNRU/s240-c-k-no/photo.jpg
)
)
)
)
[processed:protected] => Array
(
)
)
[1] => Google_Service_YouTube_Subscription Object
(
[contentDetailsType:protected] => Google_Service_YouTube_SubscriptionContentDetails
[contentDetailsDataType:protected] =>
[etag] => "xxxxxxxxxxxxxxxxx"
[id] => xxxxxxxxxxxxxxxxx
[kind] => youtube#subscription
[snippetType:protected] => Google_Service_YouTube_SubscriptionSnippet
[snippetDataType:protected] =>
[subscriberSnippetType:protected] => Google_Service_YouTube_SubscriptionSubscriberSnippet
[subscriberSnippetDataType:protected] =>
[data:protected] => Array
(
[snippet] => Array
(
[publishedAt] => 2014-03-04T13:50:42.000Z
[title] => THIS IS THE CHANNEL TITLE THAT I WANT TO GET
[description] =>
[resourceId] => Array
(
[kind] => youtube#channel
[channelId] => xxxxxxxxxxxxxxxxx
)
[channelId] => xxxxxxxxxxxxxxxxx
[thumbnails] => Array
(
[default] => Array
(
[url] => https://yt3.ggpht.com/-PYEumYpZ18E/AAAAAAAAAAI/AAAAAAAAAAA/LIZhzGw24w4/s88-c-k-no/photo.jpg
)
[high] => Array
(
[url] => https://yt3.ggpht.com/-PYEumYpZ18E/AAAAAAAAAAI/AAAAAAAAAAA/LIZhzGw24w4/s240-c-k-no/photo.jpg
)
)
)
)
[processed:protected] => Array
(
)
)
非常感謝!它的工作! – rodolfo