harvlake Posted November 29, 2009 Share Posted November 29, 2009 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 Link to comment https://forums.phpfreaks.com/topic/183278-save-remote-xml-to-local-website-folder/ Share on other sites More sharing options...
harvlake Posted November 29, 2009 Author Share Posted November 29, 2009 I think I have this figured out. Looking at another question here, I see that someone mentioned curl. Seems to have take care of my problem. Thanks for looking in. Harv Link to comment https://forums.phpfreaks.com/topic/183278-save-remote-xml-to-local-website-folder/#findComment-967355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.