string - how to strip alt character code with php -


i'm using code strip unwanted characters string, have big problem alt+0160 character non break space. need remove well

    $name = str_replace ("'", "", $name);      $name = str_replace (""", '"', $name);      $name = str_replace ("&", "&", $name);      $name = str_replace ("<", "", $name);      $name = str_replace (">", "", $name);      $name = str_replace ("&", "_", $name);      $name = str_replace ("*", "_", $name);      $name = preg_replace('/[^ \p{l}\p{n} \@ \_ \- \.]/u', '', $name); 

$name=str_replace(chr(0xc2a0),'',$name); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -