<legend id='A7b9Y'><style id='A7b9Y'><dir id='A7b9Y'><q id='A7b9Y'></q></dir></style></legend>

  1. <i id='A7b9Y'><tr id='A7b9Y'><dt id='A7b9Y'><q id='A7b9Y'><span id='A7b9Y'><b id='A7b9Y'><form id='A7b9Y'><ins id='A7b9Y'></ins><ul id='A7b9Y'></ul><sub id='A7b9Y'></sub></form><legend id='A7b9Y'></legend><bdo id='A7b9Y'><pre id='A7b9Y'><center id='A7b9Y'></center></pre></bdo></b><th id='A7b9Y'></th></span></q></dt></tr></i><div id='A7b9Y'><tfoot id='A7b9Y'></tfoot><dl id='A7b9Y'><fieldset id='A7b9Y'></fieldset></dl></div>
    <tfoot id='A7b9Y'></tfoot>

    <small id='A7b9Y'></small><noframes id='A7b9Y'>

    • <bdo id='A7b9Y'></bdo><ul id='A7b9Y'></ul>

      是否可以在没有编码的情况下在 PHP $_GET vars 中保

      时间:2023-10-03

          <i id='Koqjz'><tr id='Koqjz'><dt id='Koqjz'><q id='Koqjz'><span id='Koqjz'><b id='Koqjz'><form id='Koqjz'><ins id='Koqjz'></ins><ul id='Koqjz'></ul><sub id='Koqjz'></sub></form><legend id='Koqjz'></legend><bdo id='Koqjz'><pre id='Koqjz'><center id='Koqjz'></center></pre></bdo></b><th id='Koqjz'></th></span></q></dt></tr></i><div id='Koqjz'><tfoot id='Koqjz'></tfoot><dl id='Koqjz'><fieldset id='Koqjz'></fieldset></dl></div>

            <bdo id='Koqjz'></bdo><ul id='Koqjz'></ul>

                <small id='Koqjz'></small><noframes id='Koqjz'>

                <legend id='Koqjz'><style id='Koqjz'><dir id='Koqjz'><q id='Koqjz'></q></dir></style></legend>

                  <tbody id='Koqjz'></tbody>
              • <tfoot id='Koqjz'></tfoot>

              • 本文介绍了是否可以在没有编码的情况下在 PHP $_GET vars 中保留加号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                假设我请求此 URL:

                Say I request this URL:

                http://mydomain.com/script.php?var=2+2

                $_GET['var'] 现在将是:2 2",它应该是2+2"

                $_GET['var'] will now be: "2 2" where it should be "2+2"

                显然我可以在发送之前对数据进行编码然后解码,但我想知道这是否是唯一的解决方案.我也可以用加号替换空格,但我也想允许空格.我只想要传递的任何字符,而无需进行任何 url 解码或编码.谢谢!

                Obviously I could encode the data before sending and then decode it, but I'm wondering if this is the only solution. I could also replace spaces with plus symbols, but I want to allow spaces as well. I simply want whatever characters were passed, without any url decoding or encoding going on. Thank you!

                推荐答案

                当然.你可以读出 $_SERVER["QUERY_STRING"],自己分解,然后放弃通常的 URL 解码,或者只将 %xx 占位符转换回来.

                Of course. You could read out $_SERVER["QUERY_STRING"], break it up yourself, and then forgo the usual URL decoding, or only convert %xx placeholders back.

                preg_match_all('/(w+)=([^&]+)/', $_SERVER["QUERY_STRING"], $pairs);
                $_GET = array_combine($pairs[1], $pairs[2]);
                

                (示例仅适用于字母数字参数,不进行上述 %xx 解码.只需分解原始输入.)

                (Example only works for alphanumeric parameters, and doesn't do the mentioned %xx decoding. Just breaks up the raw input.)

                这篇关于是否可以在没有编码的情况下在 PHP $_GET vars 中保留加号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:json_encode 不会编码法语字符 下一篇:file_exists() 和 file_get_contents() 在 PHP 中名为 outpu

                相关文章

                最新文章

                <i id='C7wQM'><tr id='C7wQM'><dt id='C7wQM'><q id='C7wQM'><span id='C7wQM'><b id='C7wQM'><form id='C7wQM'><ins id='C7wQM'></ins><ul id='C7wQM'></ul><sub id='C7wQM'></sub></form><legend id='C7wQM'></legend><bdo id='C7wQM'><pre id='C7wQM'><center id='C7wQM'></center></pre></bdo></b><th id='C7wQM'></th></span></q></dt></tr></i><div id='C7wQM'><tfoot id='C7wQM'></tfoot><dl id='C7wQM'><fieldset id='C7wQM'></fieldset></dl></div>

              • <small id='C7wQM'></small><noframes id='C7wQM'>

                    <bdo id='C7wQM'></bdo><ul id='C7wQM'></ul>
                  <tfoot id='C7wQM'></tfoot>
                1. <legend id='C7wQM'><style id='C7wQM'><dir id='C7wQM'><q id='C7wQM'></q></dir></style></legend>