HTML entity converted to character: Convert Ueditor editor (in thinkphp 3.2.2) saved data

Source: Internet
Author: User

When you use the Ueditor Editor to save article content in thinkphp 3.2.2, the data that is saved in the database is escaped to entities, such as:<p><strong> <span style="font-family: Microsoft ya Black, & #39; Microsoft yahei& #39;; Color:rgb (192, 0, 0); "><em><span style=" font-family: Microsoft Ya-Black, & #39; Microsoft yahei& #39;; text-decoration:underline;">fonts</span></em& Gt;</span></strong></p>

The data that is actually deposited is:

If you are ready to edit the saved data in the background, if you do not do the appropriate processing, the edit box will appear:

You only need to handle the data when it is taken:

$con Htmlspecialchars_decode (html_entity_decode($con[' content ')]);

The saved data is displayed correctly in the edit box:

Report:

Html_entity_decode (): Converts an HTML entity to a character, which is an inverse of the htmlentities ().

Htmlspecialchars_decode (): Converts some pre-defined HTML entities to characters.

HTML entity converted to character: Convert Ueditor editor (in thinkphp 3.2.2) saved data

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.