如何使用PHP在MYSQL表中正确保存html内容

How to correctly save HTML content in the MYSQL table using PHP. I used the following functions of PHP but no luck.

$encodedHTML = htmlspecialchars($cs_htmlEditor);
$encodedHTML = urlencode($cs_htmlEditor);

You can try base64_encode and base64_decode, your column data type should be BLOB.

To encode data in base64

$encodedHTML = base64_encode($cs_htmlEditor);

To retrieve the data

$decodedHTML = base64_decode($cs_htmlEditor)