i would like to understand how to use the buffer of a read file.
Assuming we have a big file with a list of emails line by line ( delimiter is a classic \\n
\\n
Don't use file_get_contents for large files. This pulls the entire file into memory all at once. You have to read it in pieces
$fp = fopen('file.txt', 'r'); while(!feof($fp)){ //get onle line $buffer = fgets($fp); //do your stuff } fclose($fp);