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.

$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

316 Like 22 Dislike
Previous php-forum Next php-forum
Other php-forum

php mysql script to find record
Hi,

Currently I have a simple table with 4 columns. A, B, C, D

If I want to find all

Mail from PHP form not always ending up in my inbox?
Hi guys,

I'm a real newbie to PHP and have managed to put together a simple mail form that se

Word filter problem
Hello,

im trying to make a filter for words inputted in to my website but i want to store the

same querie, or a new one??
Hi guys,

I'm still working on this drop down list. I've got the actual drop down list to wor

Syntax error
hi im having a little trobble with this script
-------------------------------------------------

Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don'

INSERT for date range
Hi all

I have the following table

Code: [Select] `date` date
`day` int(2)
`

PHP Array quick help
I need

$_SESSION{'username'} to be like this:


if $_SESSION['username'] = "gay

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

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