0
我意识到在一个URL中,+符号代表一个空格,但是我需要保持加号。我怎样才能做到这一点?我的网址和代码如下:URL丢失加号
http://www.example.com/path/test.php?test=2+2
<?php
$test = $_GET['test'];
echo $test;
?>
此打印出2 2
我意识到在一个URL中,+符号代表一个空格,但是我需要保持加号。我怎样才能做到这一点?我的网址和代码如下:URL丢失加号
http://www.example.com/path/test.php?test=2+2
<?php
$test = $_GET['test'];
echo $test;
?>
此打印出2 2
+
,您需要%2B
。
的可能的复制[URL中如何编码的加号(+)符号(http://stackoverflow.com/questions/5450190/how-to-encode-the-plus-symbol -in-URL) – kwarunek