Use of htmlentities functions in PHP

Source: Internet
Author: User
The htmlentities function in PHP is so understandable to the htmlentities function. because the browser does not know the htmlentities function by directly inputting some characters, garbled characters may appear, so we need to use this function to convert some characters into entities that the browser can recognize. I don't know if this is true. Here is an example of using the htmlentities function in echohtmle PHP.
I understand the htmlentities function in this way. because the browser does not recognize the htmlentities function by directly inputting some characters, garbled characters may occur. Therefore, we need to use this function to convert some characters into entities that the browser can recognize. I don't know if this is true.

Here is an example.
Echo htmlentities ("Coffee at Caf è Francaise costs $2.25 .");
Because the browser does not know this character, the output will be garbled, so it should be converted using htmlentities.

But the problem is that I tried echo "Coffee at Caf è Francaise costs $2.25."; and I could output that one correctly.
What is the reason? Do we still need htmlentities?

------ Solution --------------------
You taught the British to speak english. it's clearly a shift.
But you teach Chinese people to speak English, but it is very common.

The browser can recognize "è", which is his mother tongue. Some browsers do not recognize "è", but you cannot kill it. What should we do? Get a saying to tell him

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.