Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function countTextLines($filename) {
- $f = fopen($filename, 'rb');
- $lines = 0;
- while (!feof($f)) {
- $buffer = fread($f, 8192);
- $lines += substr_count($buffer, "\n");
- }
- fclose($f);
- return $lines + (strlen($buffer) ? 1 : 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement