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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -