HTML string parsing display

Source: Internet
Author: User
I saved a string in html format in the database. now I need to display and display the correct html format on the interface. What should I do? Image description

I saved a string in html format in the database. now I need to display and display the correct html format on the interface. What should I do?

Image description

Reply content:

I saved a string in html format in the database. now I need to display and display the correct html format on the interface. What should I do?

Image description

By default{$ Var }}Tag output string,BladeThe template engine automatically escapes (Escape)HTMLCharacter. if native output is required, use{!! $ Var !!}Tag!

To display the information correctly, either p is not displayed on the page, or the outer tags in the database are removed and added to the page.

View your graph
The html encoding is escaped by htmlspecialchars when the page is displayed.
Otherwise, your data inventory is

Html does not display this string but the corresponding style.

If you use the editor, some editors have been escaped once by javascript during post, so you can directly echo the output in php, if you repeat htmlspecilchars (), the html code is displayed directly instead of parsed.

Https://segmentfault.com/q/1010000005995934

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.