writer Posted May 16, 2008 Share Posted May 16, 2008 I'm using the following code to copy an XML feed locally, but I'd like it to first check the remote file to see if it's the same as the original file... if so, I don't need to copy it again. <?php $content = $_POST['content']; $file = $_POST['fileName']; $content = stripslashes($content); $writeFile = fopen($file, "w"); if(fwrite($writeFile, $content)) { echo $content; } else { echo "Error writing to file"; } fclose($writeFile); ?> Link to comment https://forums.phpfreaks.com/topic/105872-saving-a-file-locally-but-comparing-it-to-existing-file-first/ Share on other sites More sharing options...
writer Posted May 16, 2008 Author Share Posted May 16, 2008 At the heart of the matter: Can I use fopen() to compare two documents? Link to comment https://forums.phpfreaks.com/topic/105872-saving-a-file-locally-but-comparing-it-to-existing-file-first/#findComment-543027 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.