I\'m guessing it\'s fgets, but I can\'t find the specific syntax. I\'m trying to read out (in a string I\'m thinking is easier) the last line added to a log file.
function seekLastLine($f) { $pos = -2; do { fseek($f, $pos--, SEEK_END); $ch = fgetc($f); } while ($ch != "\n"); }
-2 because last char can be \n
-2
\n