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