I am sending some HTML input data to a MySQL database with PHP.
One of those form inputs send the data to MySQL in JSON format.
This (an HTML paragraph with rich formatting):
“this is some text from a wysiwyg editor”
The same thing in the database would be:
"{"ops":[{"attributes":{"underline":true},"insert":"this"},{"insert":" is some "},{"attributes":{"bold":true},"insert":"text"},{"insert":" from a "},{"attributes":{"italic":true},"insert":"wysiwyg"},{"insert":" editor\n"}]}"
I’m having trouble figuring out how display the data like the above formatted string when I select and echo out the data from the database.
Simply put, I’d like to know how this forum right here uses a wysiwyg editor for creating posts and then displays the posts in the same format we used when creating it.
Please advise me with this… How can I do it?