Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. <?php
  2. $content = 'eneral';
  3. $wordsPerMinute = 200;
  4. $imgPerMinute = 6;
  5. preg_match_all("~<img~i", $content, $imgTime);
  6. $textTotal = round(count(preg_split("/s/", $content)) /  $wordsPerMinute, 1);
  7. $imgTotal = floor((count($imgTime[0]) * $imgPerMinute) / 60);
  8. $total = round($textTotal + $imgTotal);
  9.  
  10. echo ($total < 1 ? 'less than 1' : $total) . ' min';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement