I want to add a text to mysql with arabic characters, but I always get weird signs when i use preg replace.
$str = preg_rep开发者_运维问答lace('/[^a-z0-9_-äÄüÜöÖ]/isU', '', $str);
I think you can use the small letter '/u' after the regular expression, e.g.
$str = preg_replace('/[^أب]/u', '', $str);
Notice that, same problem will occur whenever you use capital '/U' after the regular expression.
精彩评论