Q:

Unable to PHP read a remote file's content

I'm a newbie with PHP programming.  I have tried and continuously failed to get the content of this unique file below:
http://nghenhacvang.net/playplaylist/5730.xml
using API get_file_contents.  The file has the following information using CHROME:  
Remote Address:23.226.231.225:80
Request URL:http://nghenhacvang.net/playplaylist/5730.xml
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=2g8id3hevm0sqo3qv8ln8n04h2; __utma=107959197.1514810948.1417822471.1417840071.1417854776.3; __utmc=107959197; __utmz=107959197.1417822471.1.1.utmcsr=search.pch.com|utmccn=(referral)|utmcmd=referral|utmcct=/search
Host:nghenhacvang.net
User-Agent:Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
Response Headersview source
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:660
Content-Type:text/xml
Date:Sat, 06 Dec 2014 10:32:55 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=15, max=100
Pragma:no-cache
Server:Apache/2.2.3 (CentOS)
Set-Cookie:SID=0a2f9b6ce1d6280ca5fa74e118a2e1b6; expires=Thu, 01-Jan-1970 01:00:00 GMT
Vary:Accept-Encoding,User-Agent
X-Powered-By:PHP/5.1.6

A:

It seems file_get_contents() doesn't work without setting a user agent.  Add an additional stream context to set the header user agent. 
$url = 'http://nghenhacvang.net/playplaylist/5730.xml';
$options = array('http' => array('user_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'));
$context = stream_context_create($options);
$contents = file_get_contents($url, false, $context);
$xml = simplexml_load_string($contents);

echo '<pre>';
print_r($xml);

Sample Output
You can also use curl as an alternative:
$url = 'http://nghenhacvang.net/playplaylist/5730.xml';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
$contents = curl_exec($ch);

$xml = simplexml_load_string($contents);

echo '<pre>';
print_r($xml);

Bonus: Here's some simple usage after the contents have been retrieved:
foreach($xml->channel->item as $item) {
    $description = (string) $item->description;
    $title = (string) $item->title;
    $jwplayer = $item->children('jwplayer', 'http://rss.jwpcdn.com/');
    $source = (string) $jwplayer->source->attributes()->file;
    $image_url = (string) $jwplayer->image;

    // presentation
    echo "
    Title: $title <br/>
    Description: $title <br/>
    Source: $source <br/>
    Image URL: $image_url <br/>
    <hr/>
    ";
}

Sample Output

