Reputation: 25
the .txt file is about 500M,when i use fopen,my computer just can not work,so i wanna any other way to finish the task
Upvotes: 0
Views: 120
Reputation: 152294
If you are running PHP script on Linux, you can do it with:
$newLine = 'some text';
$filename = 'large.txt';
system('echo "' . $newLine . '" >> ' . $filename);
Upvotes: 0
Reputation: 140236
Try
$fp = fopen( "file.txt", 'a' );
fwrite( $fp, "\n" );
fclose( $fp );
Upvotes: 1