字符串转义 保存到mysql

$str="what's this";
$en_str=htmlentities($str,ENT_QUOTES);
echo $en_str."
";

echo html_entity_decode($en_str,ENT_QUOTES);

what&#039;s  this<br/>
what's  this

原文地址:https://www.cnblogs.com/ianlab/p/13963575.html