jimenezmaximiliano/php-tail-file
最新稳定版本:1.1.6
Composer 安装命令:
composer require jimenezmaximiliano/php-tail-file
包简介
Efficiently reads the last lines of a file like the tail command
README 文档
README
Efficiently tail a file from PHP - Reads the last x number of lines of a file (similar to Unix's tail command)
- Great performance
- It doesn't load the whole file to memory
- Skips trailing new lines and empty lines
- No dependencies
- Tested on Linux, Windows and macOS
- Compatible with PHP 7.4 and ^8
Usually used to read the last lines of:
- CSV files
- Log files
- JSON files
- text files
Installation
composer require jimenezmaximiliano/php-tail-file
Usage
$numberOfLines = 2; $filePath = realpath("file.log"); $lines = Tail::tail($filePath, $numberOfLines); // ["line 30", "line 31"]
统计信息
- 总下载量: 7.68k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-09-16