开发者

preg replace with arabic

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜