fork download
  1. <?php
  2. function tooLong($word)
  3. {
  4. $length = mb_strlen($word, 'UTF-8');
  5. if ($length > 10)
  6. {
  7.  
  8. $length -= 2;
  9. $firstLetter = mb_substr($word, 0, 1);
  10. $lastLetter = mb_substr($word, -1);
  11. return $firstLetter.$length.$lastLetter."\n";
  12. }
  13. else
  14. return $word."\n";
  15.  
  16. }
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty