PHP关于反斜杠处理函数addslashes()和stripslashes()的用法

addslashes() 例子:

<?php
$str = "Who's John Adams?";
echo $str . " This is not safe in a database query.<br />";
echo addslashes($str) . " This is safe in a database query.";
?>

输出:

Who's John Adams? This is not safe in a database query.
Who\'s John Adams? This is safe in a database query.

stripslashes() 例子:

<?php
echo stripslashes("Who\'s John Adams?");
?>

输出:

Who's John Adams?
上一篇:tomcat 配置文件server.xml 详解 Connector Engine Host Context


下一篇:iPad开发--QQ空间布局,登录模块