I have a program that deletes Hand #[any number]
from a file
<?php
$file_name = 'the_file.txt';
$file = file_get_contents($file_name);
$file_handle = fopen($file_name, "w+");
fwrite($file_handle, preg_replace("/^(Hand\s#\d+)/m", "", $file));
But if I try to input a large file I get:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 68353857 bytes)
I think the solution is to edit 134217728 bytes at a time how would I do this?