简体   繁体   中英

Php str_replace and character °

Im having issues with the character ° , like 30°F. Im doing a string replace but its ignoring only this character:

str_replace(array(',', '.', ' ', '´', '°', ':', ';', '!'), "", $name);

Any ideas?

Just for the records. The degree symbol have a variant in some fonts i think on some windows word version that use a Masculine Ordinal Indicator, thats a little line under the degree symbol sort of the one used on Spanish for №, just that is really odd to see it around and in code world is just used without the little line. In my case i was replacing a file name that had it and of course my php didnt replace it and i didnt saw it either even doing a copy paste, i just notice it copying the file name on the link given by I Can Has Cheezburger.

If this is your case, check the file name and replace it with a normal degree symbol or just remove it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM