krot

mbcode

Aug 27th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. function mbcode($str){
  2.                         $r= implode('',array_map(
  3.                             function ($v){return mb_strtoupper(mb_substr($v,0,2,'UTF-8'),'UTF-8');}
  4.                             ,explode(' ',$str))).mb_strlen(str_replace(' ','',$str),'UTF-8');
  5.     $r=mb_substr($r,0,5,'UTF-8');
  6.     return $r;
  7.     }
Add Comment
Please, Sign In to add comment