什么 在读取和解释URL时在php中表示

cod*_*nja 0 php

我的系统运作完美,我的问题主要是学术性的.

这是我的情况.我为这家公司建了一个服务台.

帮助台通过添加一个来模拟URL

~.php?id=123
Run Code Online (Sandbox Code Playgroud)

我可以通过使用超全局GET从该URL中的id获取值,然后根据URL上显示的ID显示正确的解决方案.

$value_of_id = $_GET('id');
Run Code Online (Sandbox Code Playgroud)

我从来不明白,下面的网址中的问号是什么意思.

http://myhost.php?id=123-abc
Run Code Online (Sandbox Code Playgroud)

如果知道这个理论的人能够解释我的意思,我会非常感激.

Laj*_*res 7

http://www.ietf.org/rfc/rfc1738.txt

3.3.HTTP

HTTP URL采用以下形式:

  http://<host>:<port>/<path>?<searchpart>
Run Code Online (Sandbox Code Playgroud)

...

   Within the <path> and <searchpart> components, "/", ";", "?" are
   reserved.  The "/" character may be used within HTTP to designate a
   hierarchical structure.
Run Code Online (Sandbox Code Playgroud)

因此,正如其他人所说,它只是一个保留的分隔符.

本文档更新了上述内容(如DaveRandom所述):

http://tools.ietf.org/html/rfc3986#section-3.4

但我认为重点是相同的,并且更难引用这个新版本.:)