Advertisement
GWibisono

check text only

Nov 11th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. function onlyText($s)
  2. {
  3.     $s2='';
  4. $regex = '#[^a-z0-9_\',.@]#i';
  5. $val = preg_replace($regex, ' ', $s);
  6.     $a=explode(" ",$val);
  7.     foreach($a as $v)$s2.=trim($v)." ";
  8.  
  9. $val = strtoupper($s2);
  10.     return $val;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement