How can I output such HTML code as is?

Source: Internet
Author: User
Tags code tag
The Code is as follows {code ...} what is stored in the database now is this form. I need to output it to the HTML code as it is, but the direct output will be parsed, but I do not need to do so. Do not parse a word as it is. change !!

The Code is as follows:

"<Font color = \" # FF8132 \ "> caution 2: You will switch to sleep mode and cannot use </font> <font color = \" # FF8132 \ "> call, SMS and Network </font> <font color = \ "# FF8132 \"> functions. Are you sure you want to change? </Font>"

Currently, this format is stored in the database.

I need to output it to HTML code as it is, but the direct output will be parsed

But I don't need this.

Output as is


Do not parse a word !!

Reply content:

The Code is as follows:

"<Font color = \" # FF8132 \ "> caution 2: You will switch to sleep mode and cannot use </font> <font color = \" # FF8132 \ "> call, SMS and Network </font> <font color = \ "# FF8132 \"> functions. Are you sure you want to change? </Font>"

Currently, this format is stored in the database.

I need to output it to HTML code as it is, but the direct output will be parsed

But I don't need this.

Output as is


Do not parse a word !!

Usehtmlspecialchars


  

StrongEscape Character \

Htmlspecialchars

With the code tag, the code in the tag is not parsed and output as is. However, the code only applies to a single line. You must use multiple lines of code such as the subject.

Label. From http://www.imooc.com/code/144

1. Put it in textarea.
2. Second escape & Symbol

A built-in function of decodeURI

The htmlspecialchars_decode function can be used directly in php.

echo htmlspecialchars_decode($str);

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.