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. }

URL: http://provode.com/2013/11/copying-mediums-estimated-reading-time/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.