PHP code example of vdhicts / read-time

1. Go to this page and download the library: Download vdhicts/read-time 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/ */

    

vdhicts / read-time example snippets


read_time($text);
read_time($text, $wordPerMinute);

@readTime($text)
@readTime($text, $wordPerMinute)

use Vdhicts\ReadTime\ReadTime;

$readTime = new ReadTime($text);
// OR $readTime = new ReadTime($text, $wordsPerMinute);
$readTime->minutes(); // the amount of minutes (as integer) it should take to read
$readTime->seconds(); // the amount of seconds (as integer) it should take to read
$readTime->wordCount(); // the amount of words (as integer) found in the text