我的字符串$ name =“ Ali'Shan”; 我想将其存储到数据库中,但是“我使用htmlentities / htmlspecialchars和str_replace但插入后,我仍然收到语法错误”。
$name = "Ali'Shan";
str_replace("'", "", $name);
echo $name;
echo htmlentities($name);
我的输出仍然是Ali'Shan
使用 addslashes() or mysql_real_escape_string()
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句