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

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

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

        如何使用PHP抓取URL参数?

        How to grab URL parameters using PHP?(如何使用PHP抓取URL参数?)
            <bdo id='0HlRH'></bdo><ul id='0HlRH'></ul>
              <tbody id='0HlRH'></tbody>

                <legend id='0HlRH'><style id='0HlRH'><dir id='0HlRH'><q id='0HlRH'></q></dir></style></legend>
                <i id='0HlRH'><tr id='0HlRH'><dt id='0HlRH'><q id='0HlRH'><span id='0HlRH'><b id='0HlRH'><form id='0HlRH'><ins id='0HlRH'></ins><ul id='0HlRH'></ul><sub id='0HlRH'></sub></form><legend id='0HlRH'></legend><bdo id='0HlRH'><pre id='0HlRH'><center id='0HlRH'></center></pre></bdo></b><th id='0HlRH'></th></span></q></dt></tr></i><div id='0HlRH'><tfoot id='0HlRH'></tfoot><dl id='0HlRH'><fieldset id='0HlRH'></fieldset></dl></div>
              • <tfoot id='0HlRH'></tfoot>
                1. <small id='0HlRH'></small><noframes id='0HlRH'>

                  本文介绍了如何使用PHP抓取URL参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试图获取每个 URL 参数并从头到尾显示它们,但我希望能够在页面上的任何位置显示任何参数.我怎样才能做到这一点?我必须在我的脚本上添加或修改什么?

                  I'm trying to grab each URL parameter and display them from first to last, but I want to be able to display any of the parameters anywhere on the page. How can I do this? What do I have to add or modify on my script?

                  这是一个 URL 值示例.

                  Here is an example of a URL value.

                  http://www.localhost.com/topics/index.php?cat=3&sub1=sub-1&sub2=sub-2&sub3=sub-3&sub4=sub-4
                  

                  这是我的 PHP 脚本.

                  Here is my PHP script.

                  $url = $_SERVER['QUERY_STRING'];
                  $query = array();
                  
                  if(!empty($url)){
                    foreach(explode('&', $url) as $part){
                      list($key, $value) = explode('=', $part, 2);
                      $query[$key] = $value;
                    }
                  }
                  

                  推荐答案

                  您不需要手动执行此操作,PHP 已经在 $_GET 全局变量中提供了此功能:

                  You don't need to do that manually, PHP already provides this functionality in the $_GET global variable:

                  <?php
                      foreach($_GET as $key => $value)
                          echo $key . " : " . $value;
                  ?>
                  

                  这篇关于如何使用PHP抓取URL参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                2. <small id='qPsl3'></small><noframes id='qPsl3'>

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