Skip to content

Instantly share code, notes, and snippets.

@abass
Created January 22, 2014 06:18
Show Gist options
  • Save abass/8554216 to your computer and use it in GitHub Desktop.
Save abass/8554216 to your computer and use it in GitHub Desktop.
function read_time($text){
$words = str_word_count(strip_tags($text));
$min = floor($words / 200);
if($min === 0){
return 'min read';
}
return $min . 'min read';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment