Save HTML content via PHP in MySQL database
There are different ways to save the HTML data into the database table
- base64_encode(): encode HMTL code into base64 format by using the PHP function base64_encode() and save the string into a table.
To view the saved content, decode the base64 code into HTML by using base64_decode()
2. Using htmlentities(): In htmlentites(), HTML code is converted in characters string and that can be easily saved to the database table, as per see the given screenshot with example: