icawebdesign / reading-time
Calculate indication of length of time to read an article
1.2.0
2022-10-02 13:07 UTC
Requires
- php: >=7.2.0
Requires (Dev)
- orchestra/testbench: ^4.5
- phpmd/phpmd: ^2.8
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-11-27 03:17:14 UTC
README
Requirements
- PHP 7.2.0+
Installation
composer require icawebdesign/reading-time
Usage
// Return number of minutes $readingTime = new ReadingTime(); $minutes = $readingTime->minutes($string); // eg: 5
// Return minutes with suffix $readingTime = new ReadingTime(); $readingLength = $readingTime->minutesWithSuffix($string); // eg: 5 minute read
// Change reading speed (default: 250 words-per-minute) $readingTime = new ReadingTime(400); $minutes = $readingTime->minutes($string);
// Change suffix string $readingTime = new ReadingTime(); $readingLength = $readingTime->minutesWithSuffix($string, 'mins reading');
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ian.h@digiserv.net instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.