estimated reading time function (modified)

/ Published in: PHP
Save to your folder(s)

used ceil instead floor

Copy this code and paste it in your HTML
  1. function read_time($text){
  2. $words = str_word_count(strip_tags($text));
  3. $min = ceil($words / 200);
  4. return $min . ' min read';
  5. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.