Code: Select all
<?php
function readURL($url) {
$FileArray = file($url);
return $FileArray;
}
readURL('http://www.nytimes.com/services/xml/rss/nyt/Business.xml');
print_r $FileArray;
?>Moderator: General Moderators
Code: Select all
<?php
function readURL($url) {
$FileArray = file($url);
return $FileArray;
}
readURL('http://www.nytimes.com/services/xml/rss/nyt/Business.xml');
print_r $FileArray;
?>Code: Select all
$FileArray = readURL('http://www.nytimes.com/services/xml/rss/nyt/Business.xml');Code: Select all
<?php
header("Content-Type: text/plain");
function readURL($url) {
$FileArray = file($url);
return $FileArray;
}
$FileArray = readURL('http://www.nytimes.com/services/xml/rss/nyt/Business.xml');
print_r($FileArray);
?>Code: Select all
Array
(
[0] => <?xml version="1.0"?>
[1] => <rss xmlns:dc="http://dublincore.org/documents/dcmi-namespace/" xmlns:media="http://search.yahoo.com/mrss" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0" version="2.0">
[2] => <channel>
[3] => <title>NYT > Business</title>
[4] => <link>http://www.nytimes.com/pages/business/index.html?partner=rssnyt</link>
[5] => <description/>
[6] => <language>en-us</language>
[7] => <copyright>Copyright 2008
[8] => The New York Times Company</copyright>
[9] => <lastBuildDate>Sun, 19 Oct 2008 21:45:08 GMT
[10] => </lastBuildDate>
[11] => <image>
[12] => <title>NYT > Business</title>
[13] => <url>http://graphics.nytimes.com/images/section/NytSectionHeader.gif</url>
[14] => <link>http://www.nytimes.com/pages/business/index.html</link>
[15] => </image>
[16] => <item>
[17] => <title>The Reckoning: Building Flawed American Dreams</title>
[18] => <link>http://www.nytimes.com/2008/10/19/business/19cisneros.html?partner=rssnyt&emc=rss</link>
[19] => <guid isPermaLink="true">http://www.nytimes.com/2008/10/19/business/19cisneros.html</guid>
[20] => <media:group>
[21] => <media:content>
[22] => <media:url>http://graphics8.nytimes.com/images/2008/10/18/business/19cisneros-75.jpg</media:url>
[23] => <media:medium>image</media:medium>
[24] => <media:height>75</media:height>
[25] => <media:width>75</media:width>
[26] => </media:content>
[27] => <media:description>Henry G. Cisneros</media:description>
[28] => <media:credit>Erich Schlegel for The New York Times</media:credit>
[29] => </media:group>
[30] => <description>For years Henry G. Cisneros helped low-income families buy homes, part of a trend with dire consequences.<br/><br/><span class="advertisement"> <a href="http://www.pheedo.com/click.phdo?x=b4d3f98f99d448c0ae34d28d64593f7b&u=http://www.nytimes.com/2008/10/19/business/19cisneros.html"><img src="http://www.pheedo.com/img.phdo?x=b4d3f98f99d448c0ae34d28d64593f7b&u=http://www.nytimes.com/2008/10/19/business/19cisneros.html" border="0"/></a></span>
[31] => </description>
[32] => <dc:creator>By DAVID STREITFELD and GRETCHEN MORGENSON</dc:creator>
[33] => <pubDate>Sun, 19 Oct 2008 16:25:08 GMT</pubDate>
[34] => <category domain="http://www.nytimes.com/namespaces/keywords/nyt_per">Cisneros, Henry G</category>
[35] => <category domain="http://www.nytimes.com/namespaces/keywords/des">Subprime Mortgage Crisis</category>
[36] => <category domain="http://www.nytimes.com/namespaces/keywords/des">Housing</category>
[37] => <category domain="http://www.nytimes.com/namespaces/keywords/des">Mortgages</category>
[38] => <category domain="http://www.nytimes.com/namespaces/keywords/nyt_org_all">KB Home|KBH|NYSE</category>
[39] => <category domain="http://www.nytimes.com/namespaces/keywords/mdes">Foreclosures</category>
[40] => <category domain="http://www.nytimes.com/namespaces/keywords/nyt_org_all">Countrywide Financial Corp</category>
[41] => <category domain="http://www.nytimes.com/namespaces/keywords/nyt_org_all">Housing and Urban Development Department</category>
[42] => </item>
...