How to prevent html tags from being escaped when submitting data in Baidu editor is currently under development using ThinkPHP. after submitting text content to phpmyadmin using Baidu editor, the original data format tags have been escaped, the following information is displayed in the database: <p> & nbsp;
After the front-end calls the database, the browser resolves
The original format cannot be displayed.
Is there any better solution? How can I prevent html tags from being escaped when a form is submitted? Thank you!
Reply to discussion (solution)
$str = "<p> ";$html = htmlspecialchars_decode($str);var_dump($html);
After the database is retrieved, it will be OK once it is transferred.
The server code of the Baidu editor sample is
// Get Data $ content = htmlspecialchars (stripslashes ($ _ POST ['myeditor']);
If you copy it, it will be escaped!
$ Content = stripslashes ($ _ POST ['myeditor']);
No Escape
Old Xu is very diligent, like!
I use
htmlspecialchars_decode
Onmouseenter