部分包括URL
串的建設如下:如何在PHP字符串中有撇號?我<code>PHP</code>代碼
$msg = $_REQUEST["msg"];
$content = 'action=sendmsg'.
'&user='.rawurlencode($username).
'&password='.rawurlencode($password).
'&to='.rawurlencode($destination).
'&text='.rawurlencode($msg);
當$msg
恰好包含撇號,它被髮送爲"\'"
。
我需要做些什麼來確保PHP
沒有插入反斜槓?
'urlencode()'和'rawurlencode()'有什麼區別? – CJ7 2013-03-11 04:21:08
檢查此:http://stackoverflow.com/questions/996139/php-urlencode-vs-rawurlencode – Raptor 2013-03-11 04:25:08
更新答案。只是好奇你如何使用查詢字符串。 – Raptor 2013-03-11 04:27:02