Fetching a remote XML doc: 2
Source code
1
<?php include('./.config.php');
2 // Four ways to fetch an XML document via http: Part 2 of 4
3 // Use cURL. It's fast, it's easy and it works.
4
5 $ch = curl_init("http://rss.news.yahoo.com/rss/oddlyenough");
6 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
7 $xml = curl_exec($ch);
8 curl_close($ch);
9 echo '<pre>'. htmlentities($xml) .'</pre>';
10
11 include('./.footer.php')?>
Output
<!-- rc3.ops.sp1.yahoo.com uncompressed/chunked Sat May 19 11:11:57 UTC 2012 -->
previous: Fetching a remote XML doc: 1
Last update 24-Apr-2005 2:22 pm | up | list examples | home