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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -