PHP: regular expression to remove `â` or `â€`?
问题 I use this regular expression to remove all the punctuation marks from a string input, $pg_url = preg_replace("/\W+/", " ", $pg_url); but there are some kind of symbols or special characters I can't remove them, such as – when I pass this into my db injection, it will either turns into â or †How can I get rid of these strange stuff? Thanks. 回答1: Those characters are encoded in Unicode, specifically UTF-8. You may want to consider using the iconv family of functions to convert them into some