How can I split a large text file into separate files by character count using PHP? So a 10,000 character file split every 1000 characters would be split into 10 files. Further, can I split only after a full stop is found?Thanks.UPDATE 1: I like zombats code and I removed some errors and have come up with the following, but does anyone know how to only split after a full stop?\[code\]$i = 1; $fp = fopen("test.txt", "r"); while(! feof($fp)) { $contents = fread($fp,1000); file_put_contents('new_file_'.$i.'.txt', $contents); $i++; }\[/code\]UPDATE 2:I took zombats suggestion and modified the code to that below and it seems to work - \[code\]$i = 1; $fp = fopen("test.txt", "r"); while(! feof($fp)) { $contents = fread($fp,20000); $contents .= stream_get_line($fp,1000,"."); $contents .="."; file_put_contents("Split/".$tname."/"."new_file_".$i.".txt", $contents); $i++; }\[/code\]