Calculate the estimated reading time for a given piece of content in PHP
May 29, 2020, 01:12 AM
function estimated_reading_time( $content = '', $wpm = 250 ) {
$clean_content = strip_tags( $clean_content );
$word_count = str_word_count( $clean_content );
$time = ceil( $word_count / $wpm );
return $time;
}