I have one.txt and two.txt I wish to merge them both into total.txt
Any ideas where to start with this? I';ve tried fopen() but I've had no joy so far..
Thanks
just use [man]file_get_contents[/man] to read both files into strings, concatenate the strings, then use [man]fput[/man] to write them to the output file and [man]unlink[/man] to delete any spare files
You could try the following:
1) Use file_get_contents() to get the contents of the first file and store it to a variable. then...
2) pass that variable fwrite() to append the first file to the second file.
cheers - worked a treat 🙂