As a workaround, you could use the shell. If the code must be portable, this would only include about two variants for Windows and Linux (covering MacOS as well).
Linux
cat file1.txt file2.txt > file.txt
Windows
copy file1.txt+file1.txt file.txt
Note that when creating a command line, escaping the variable arguments is very important. Use escapeshellarg()
to wrap the filenames (see http://de1.php.net/escapeshellarg).
To detect whether you are on Windows or Linux, have a look at the constant PHP_OS
. (best explained here: http://www.php.net/manual/en/function.php-uname.php)