home
search
help
profile
liking the experience? our app is even better
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now  
showing results for php text reading time estimated
1* Calculate the estimated reading time for a given piece of $content depending on words count.
2*
3* @param string $content Content to calculate read time for.
4* @param int $wpm Estimated words per minute of reader.
5*
6* @returns	int $time Estimated reading time.
7*/
8function site_estimated_reading_time( $content = '', $wpm = 250 ) {
9    $clean_content = strip_shortcodes( $content );
10    $clean_content = strip_tags( $clean_content );
11    $word_count = str_word_count( $clean_content );
12    $time = ceil( $word_count / $wpm );
13    return $time;
14}
upvote
downvote
source
queries leading to this page