如何获得Youtube频道的订阅者数量?

I used this code...

$youtube_url = json_decode( file_get_contents( 'http://gdata.youtube.com/feeds/api/users/channelname?v=2&alt=json' ), true );
$youtube_data = $youtube_url['entry']['yt$statistics']['subscriberCount'];

...but there is an error:

"Warning: file_get_contents(http://gdata.youtube.com/feeds/api/users/nikitaplay?v=2&alt=json) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 410 Gone in..."

I am bad in PHP, so I don't understand this error

UPDATE: Also I used this code...

$youtube_url = json_decode( file_get_contents( 'https://www.googleapis.com/youtube/v3/channels?part=statistics&id=d1chArLU0voGrMzbUM4G-A&key=AIzaSyCwAooaPaSzPEcDBULe-7jI3XZ6ZYRmiNY' ), true );

...but there is an error:

Warning: file_get_contents(https://www.googleapis.com/youtube/v3/channels?part=statistics&id=d1chArLU0voGrMzbUM4G-A&key=AIzaSyCwAooaPaSzPEcDBULe-7jI3XZ6ZYRmiNY) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in...

1) Log in to a Google account and go to https://console.developers.google.com/. You may have to start a new project.

2) Navigate to APIs & auth and go to Public API Access -> Create a New Key

3) Choose the option you need (I used 'browser applications') This will give you an API key.

4) Navigate to your channel in YouTube and look at the URL. The channel ID is here: https://www.youtube.com/channel/YOUR_CHANNEL_ID

5) Use the API key and channel ID to get your result with this query: https://www.googleapis.com/youtube/v3/channels?part=statistics&id=YOUR_CHANNEL_ID&key=YOUR_API_KEY

Get an API Key for Youtube v3 in https://console.developers.google.com

$apiKey = 'puthereyouapikey';
$chanelId = 'channelid';
$json = json_decode((file_get_contents('https://www.googleapis.com/youtube/v3/channels?part=statistics&id='.$channelId.'&key='.$apiKey)), true);
echo ($json != NULL) ? (($json['items']['0']['statistics']['subscriberCount'])) : '';