+ 2
How to copy whole content of one file to another file in PHP...??
5 Answers
+ 7
It convert all data of a file in array, use file_get_content() it return a string. Moreover I was talking about easy and fast method, file cannot be fast and good in all cases. Thats why there are many function in PHP to do same thing
+ 3
Have a look here:
//Get all the content from the file
$fileContents = file_get_contents('1.txt');
//Output to new file
$fh = fopen('output.txt', 'w+');
foreach ($matches as $match) {
fputs($fh, $match."\r\n"); //now put the copied content in this new file
}
fclose($fh);
+ 2
well it depends upon which type of file binary or text and what it's size, tell me I will give you answer
+ 2
i got some clue by thay "file()" function
+ 2
i am asking about anykind of files.......