PHP regular match or str_replace How to replace the English degree of this symbol?

Source: Internet
Author: User
Want to the English degree this special symbol to "", has not been tuned how to write, does anyone know? Help Ah, thank you!


Reply to discussion (solution)

Well, no one answered.

You go straight to the code, let's see what's wrong.

"Zgy 90°" just wants to remove the symbol of this string.

Code 1

$str = "Zgy 90°"; Echo str_replace (' ° ', ' ', $str);

$str = "dfdfsdsf°°°°zgy°°°°90°"; Echo str_replace (' ° ', ', $str). "
echo preg_replace ('/(°) +/', ', $str);

Strange I also used the str_replace, the result is not right, according to you give this to solve
Thank you so much!

Character Set problem!

New document, renamed as PHP, this file is not the default or gb2312 encoding Ah, always have to be converted to Utf-8 code, special symbols are displayed

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.