Hi guys,
I have written a piece of code which will create an RSS file and export data into the file. I will be running this file on the server at set intervals such as every 15 minutes so therefore I need to create a file, then 15mins later overwrite the file with a new updated version from the database.
The following code is what I have so far:
How can I modify this code to ensure that if a file already exists on my webserver it will automatically be overwritten with the new file produced by this code?
Any help would be appreciated. Cheers
I have written a piece of code which will create an RSS file and export data into the file. I will be running this file on the server at set intervals such as every 15 minutes so therefore I need to create a file, then 15mins later overwrite the file with a new updated version from the database.
The following code is what I have so far:
Code:
$handle = fopen("$full_path", "x+");
$xml = "stuff goes here from database";
fwrite($handle, $xml);
fclose($handle);
How can I modify this code to ensure that if a file already exists on my webserver it will automatically be overwritten with the new file produced by this code?
Any help would be appreciated. Cheers