View Full Version : Copying the contents of one file to another
09-10-2005, 08:53 PM
Does anyone know how to make the contents of a file a variable so they can be added to the end of another file... I tried to use !copy, not realizing that it literally copied the file onto the other. I've tried the php.net manual, but I can't find anything that works. Its probably something really simple but its been bugging me for the last hour, since I got everything else working but this.
09-10-2005, 09:11 PM
fopen() with mode a or a+
PHP5: file_put_contents() with FILE_APPEND flag
09-10-2005, 09:38 PM
09-10-2005, 10:51 PM
09-10-2005, 11:32 PM
Ahh sorry, I should have made it more clear... I was talking about an easy way to get the entire file as a string (to then be written using fopen()/fwrite()).
09-11-2005, 12:45 AM
Can someone explain the usage of file_get_contents since I can't seem to get anything but false whenever I use it.
09-11-2005, 12:56 AM
09-11-2005, 02:25 AM
Wow! Thanks, it works :thumbsup:
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.