Created
February 22, 2018 18:50
-
-
Save simbalinux/14e97a0377f737fb881089c499e8134b to your computer and use it in GitHub Desktop.
PHP last 5 lines of log file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = file("../log/simplelogger.log"); | |
for ($i = max(0, count($file)-5); $i < count($file); $i++) { | |
var_dump($line); | |
echo $file[$i] . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment