Save remote XML to local website folder


Posted on 16th Feb 2014 07:03 pm by admin

Hi, I hope you can help me out. I would like to be able to pull an XML file from another site and then store it in a local folder on my site. That way, I would only need to pull the xml file once in a while instead of every time someone opens that page.

here is a snippet of code I found, but the size of the saved XML file is smaller and is not consistently the same size of file. Some of the information gets lost.

Did you know?Explore Trending and Topic pages for more stories like this.
$fp = fopen( 'http://forecast.weather.gov/MapClick.php?lat=45.21640&lon=-112.63700&FcstType=dwml', 'r' );
$string = fread( $fp, 1024*9 );
fclose( $fp );

$fp = fopen( 'weather.xml', 'w' );
fwrite( $fp, $string );
fclose( $fp );

I hope I explained that
No comments posted yet

Your Answer:

Login to answer
316 Like 22 Dislike
Previous forums Next forums
Other forums

Sending an SMS Message with ASP.NET
Often times it may be a requirement for your web application to send an SMS message. Such examples w

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

Saas with SAP R/3
hi experts,

Is SaaS offer available in SAP? for SAP R/3? from where i can get the info a

Xacute search within SQL results
I have a query that is pulling data, and I want to return a specific value from the results of that

Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let s

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

PHP page is blank
Hi Everyone,

I have a site in which I am able to open the first PHP webpage in my browser but

I got my hosting suspended XD
So I saw this challenge a day or so ago

http://www.programming-challenges.com/pg.php?page=dow

Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different pl

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash