本文介绍了如何在PHP字符串中使用撇号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
部分我的 PHP 代码包括构建一个 URL 字符串,如下所示:
Part of my PHP code includes the construction of a URL string as follows:
$msg = $_REQUEST["msg"]; $content = 'action=sendmsg'. '&user='.rawurlencode($username). '&password='.rawurlencode($password). '&to='.rawurlencode($destination). '&text='.rawurlencode($msg);当 $ msg 恰好包含一个撇号,它被发送为\。
When $msg happens to contain an apostrophe, it get sent as "\'".
我需要做什么才能确保反斜杠没有插入 PHP ?
What do I need to do to make sure the backslash is not inserted by PHP?
推荐答案你可能想查看striplashes: php/manual/en/function.stripslashes.php
You probably want to check out stripslashes: php/manual/en/function.stripslashes.php
更多推荐
如何在PHP字符串中使用撇号?
发布评论