这个基本的PHP URL叫什么? [英] What's this basic PHP URL thing called?

查看:53
本文介绍了这个基本的PHP URL叫什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Codeproject,



我想知道URL(带有PHP网站)的部分被调用了什么,允许额外的信息。



我正在谈论的具体部分是'mysite.com?section=value'。



我希望能够写一个简单的if(section = value),然后执行一个特定的代码,但由于我不知道它的名字,我在Google上找不到它。



最好的问候,

- Nostarik

解决方案

字符串出现在' '标记为'查询字符串'。



因此,在您的示例中,' section = value '是查询字符串,其中' section '是查询您可以在查询字符串中添加更多参数:



'mysite.com?section=value§ion2=value2§ion3=值3

这是您需要知道的: http://en.wikipedia.org/wiki/URI_scheme [ ^ ]。



对于解析它,您可以使用:

http:// php。 net / manual / en / function.parse-url.php [ ^ ]。



现在,使用PHP,您不必解析所有URI字符串。您可以使用

  


query =


Hello Codeproject,

I was wondering what the section in a URL(with a PHP website) was called that allows for extra information.

The specific section I'm talking about is something along the lines of 'mysite.com?section=value".

I'd like to be able to write a simple if(section = value), and then perform a specific code, but since I don't know the name of it I can't find it on Google.

Best Regards,
- Nostarik

解决方案

The string appears in the URL after '?' mark is called 'Query String'.

So, in your example, 'section=value' is the query string where 'section' is the query parameter. You can add more parameters in the query string as:

'mysite.com?section=value§ion2=value2§ion3=value3'


This is what you need to know: http://en.wikipedia.org/wiki/URI_scheme[^].

For parsing it, you could use:
http://php.net/manual/en/function.parse-url.php[^].

Now, with PHP, you don't have to parse all the URI string. You can use


query =


这篇关于这个基本的PHP URL叫什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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