visavi / librator
Class text library to read and process text from a file by pages
v1.3
2016-06-27 07:10 UTC
Requires
- php: >=5.4.0
- visavi/paginator: ~1.1
This package is auto-updated.
Last update: 2025-01-20 01:19:28 UTC
README
Basic useful feature list:
- Reading text files
- A breakdown of the text on page
- Splits text based on the number of lines, number of words and characters to choose from
- Beautiful displays pages, with the ability to jump to the last and first page
- Automatic output of the header text from the first row
- The output of the current page
Example of use
<?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();
Installing
composer require visavi/librator
License
The class is open-sourced software licensed under the MIT license