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
Post a Comment