PHP Getting the last xx bytes of a large text file
Sometimes the text files are very large and you don’t want to load it in memory before searching through it because it’s inefficient. You just want to get the last few bytes of the file because the latest additions / updates are there. This would help you: $fp = fopen(‘somefile.txt’, ‘r’); fseek($fp, -50, SEEK_END); // …
PHP Getting the last xx bytes of a large text file Read More »