Make copy of XML page using PHP

silentmind

New Member
I'm trying to use Javascript to access data from http://www.bart.gov/dev/eta/bart_eta.xml , however, I found out that I cannot do that unless I have a copy of that page on my server. How can I make a proxy page on my server that is an exact copy of http://www.bart.gov/dev/eta/bart_eta.xml ? I have already tried simplexml_load_file and file_get_contents, however both functions do not give me the XML format, they give me something like \[code\]object(SimpleXMLElement)#1 (2) { ["channel"]=> object(SimpleXMLElement)#2 (6) { ["title"]=> string(23) "BART Real Time ETA Feed" ["link"]=> string(50) "http://www.bart.gov/schedules/developers/etas.aspx" ["description"]=> string(127) "Real time estimated arrivals for Bay Area Rapid Transit. Use subject to terms at http://www.bart.gov/dev/schedules/license.htm" ["copyright"]=> string(86) "Copyright (C) 2012 San Francisco Bay Area Rapid Transit District. All rights reserved." ["date"]=> string(10) "07/01/2012" ["time"]=> string(15) "02:52:39 PM PDT" } ["station"]=> array(44) { [0]=> object(SimpleXMLElement)#3 (5) { ["name"]=> string(12) ...\[/code\]
 
Back
Top