Article From:

Do not want to use the file_get_contents function, because the file is too large.

Answer 0:
$fp = fopen('a.txt', 'r+');
fseek($fp, 1024);
fwrite($fp, str_repeat('a', 30));

Answer 1:

Using SPL extended SplFileObject class to process large files

$oFile = new SplFileObject($filename,'w');



$oFile = null;

Leave a Reply

Your email address will not be published. Required fields are marked *