visavi / librator
按页读取和处理文本文件的文本库
v1.3
2016-06-27 07:10 UTC
Requires
- php: >=5.4.0
- visavi/paginator: ~1.1
This package is auto-updated.
Last update: 2024-09-20 00:36:40 UTC
README
基本实用功能列表
- 读取文本文件
- 页面文本的分解
- 根据行数、单词数和字符数来分割文本
- 美丽地显示页面,具有跳转到最后一页和第一页的能力
- 自动输出第一行的标题文本
- 当前页面的输出
使用示例
<?php // Connect class include 'src/Librator.php'; // Open the text file library.txt $librator = new Visavi\Librator('library.txt'); // The number of output lines $librator->read(20); // Or split the file by the number of words $librator->read(300, 'words'); // Or split the file by the number of characters $librator->read(2000, 'chars'); // Get current page $librator->currentPage(); // Automatic output of the header text from the first row $librator->getTitle();
安装
composer require visavi/librator
许可协议
该类是开源软件,采用MIT许可证授权