I am creating a laravel web application for a client which allows them to store information into a database.
So i am using a WYSIWYG editor to allow the users to enter data with bullet points, bold text and underlines ect...
Now when i save the description to my database it looks like this.
test test<div><br></div><div><br></div><div><b>egergererh<i>this is a bullet</i><u><i>hello</i>egerg</u>ewg</b>ewg</div><div><br></div><div><ul><li>wegwe</li></ul><ol><li>ewg</li></ol></div>
So when the user previews the page with the description i want it to show with the html marked up. But instead I find a string of html that looks like this on my page.(not the real thing for an example)
test test <div><br/><div></div></div>
How do i retrieve the description from the database and present it to the page as html?
i have tried
htmlspecialchars_decode()
but this doesnt do anything.
try it with:
<?php
$str = 'test test<div><br></div><div><br></div><div><b>egergererh<i>this is a bullet</i><u><i>hello</i>egerg</u>ewg</b>ewg</div><div><br></div><div><ul><li>wegwe</li></ul><ol><li>ewg</li></ol></div>';
echo html_entity_decode($str);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With