PHP and xml HELP NEEDED

My flash site loads an xml file (blog.xml); the xml is from a remote site and updated through blog software (I’ve saved it locally for flash to read, but I don’t want to manually save the file everytime it’s updated).

So I’m looking for a php script that will grab the blog.xml remote file (domain1.com) and save it to the local server (domain2.com) as “blog.xml”.

I’m think that the script could either be run by flash requesting it, or having the server cron job run the script every so often. Please help.

this is the code I’ve come up with so far. It doesn’t work obviously.

<?
$file = “http://feeds.feedburner.com/SuperSmilesOrthodontics/Blog.xml”;

$fr = fopen($file, “r”);
$contents = fread ($fr, 1000000);
fclose($fr);

$fp = fopen(“blog.xml”, “w”);
fputs($fp, $contents);
fclose($fp);

?>