网址丢失加号 [英] URL losing plus sign

查看:91
本文介绍了网址丢失加号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到在URL中,+符号代表一个空格,但是我需要保留加号.我怎样才能做到这一点?我的网址和代码如下:

I realize that in a URL, the + symbol represents a space, however I need to keep the plus sign. How can I do this? My URL and code are as follows:

http://www.example.com/path/test.php?test=2+2

<?php
$test = $_GET['test'];

echo $test;
?>

这将打印出2 2

推荐答案

  • 解释为URL中的空格.要使用+,您需要%2B.
    • is intepreted as a space in a URL. To use a + you need %2B.
    • http://example.com/path/test.php?test= 2%2B2

      这篇关于网址丢失加号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆