1. Go to this page and download the library: Download realodix/readtime library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
realodix / readtime example snippets
use Realodix\ReadTime\ReadTime;
$readTime = new ReadTime('foo bar');
echo $readTime->get();
// less than a minute
/**
* @param string|array $content The content to analyze
* @param int $wpm Speed of reading the text in Words per Minute
* @param int $imageTime Speed of reading the image in seconds
* @param int $cpm Speed of reading the Chinese / Korean / Japanese
* characters in Characters per Minute
*/
$readTime = new ReadTime($content, $wpm = 265, $imageTime = 12, $cpm = 500);
echo $readTime->get();
$readTime = new ReadTime([$content, $moreContent, $evenMoreContent]);
echo $readTime->get();
[
'less_than' => 'less than a minute',
'one_min' => '1 min read',
'more_than' => 'min read',
];