Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $content = 'eneral';
- $wordsPerMinute = 200;
- $imgPerMinute = 6;
- preg_match_all("~<img~i", $content, $imgTime);
- $textTotal = round(count(preg_split("/s/", $content)) / $wordsPerMinute, 1);
- $imgTotal = floor((count($imgTime[0]) * $imgPerMinute) / 60);
- $total = round($textTotal + $imgTotal);
- echo ($total < 1 ? 'less than 1' : $total) . ' min';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement