Found in the open code. It is very convenient and works quickly even with large files, but I failed to display more than one line. Is it possible for them to display the last 10 lines of the file?
<?php $f = fopen("email.log", "r"); if($f){ if(fseek($f, -1, SEEK_END) == 0){//Π² ΠΊΠΎΠ½Π΅Ρ ΡΠ°ΠΉΠ»Π° -1 ΡΠΈΠΌΠ²ΠΎΠ» ΠΏΠ΅ΡΠ΅Π²ΠΎΠ΄Π° ΡΡΡΠΎΠΊΠΈ $len = ftell($f); for($i = $len; $i > ($len-5000); $i--){//5000 - ΠΏΡΠ΅Π΄ΠΏΠΎΠ»Π°Π³Π°Π΅ΠΌΠ°Ρ ΠΌΠ°ΠΊΡ. Π΄Π»ΠΈΠ½Π° ΡΡΡΠΎΠΊΠΈ fseek($f, -2, SEEK_CUR); if(fread($f,1) == "\n")//Π΅ΡΠ»ΠΈ Π²ΡΡΡΠ΅ΡΠΈΠ»ΡΡ ΠΏΡΠΈΠ·Π½Π°ΠΊ ΠΊΠΎΠ½ΡΠ° ΡΡΡΠΎΠΊΠΈ break; } echo 'line start:',$i, '<br>'; echo fread($f, $len - $i);//ΠΏΠΎΡΠ»Π΅Π΄Π½ΡΡ ΡΡΡΠΎΠΊΠ° } fclose($f); }