形如 index.php/explore-page/colors/pink-color 的地址栏 应该如何理解

WBOY
Release: 2016-06-13 12:00:18
Original
1171 people have browsed it

形如 index.php/explore-page/colors/pink-color 的地址栏 应该怎么理解?
以前所接触过的链接地址是形如:index.php?key1=val1&key2=val2
但是在 index.php/explore-page/colors/pink-color 中 哪个是参数名称 哪个是值呢?
------解决方案--------------------
这个是人家框架路由定义好的。
具体要看路由是怎么定义的


------解决方案--------------------
 index.php/explore-page/colors/pink-color
这是 path_info 格式的 url
其中 
index.php 是处理程序
/explore-page/colors/pink-color 是传递的参数
每一节代表一个参数,这里就是 3 个了

程序从 $_SERVER['PATH_INFO'] 取得参数串后,按 / 切割成数组
如何解释数组元素的含义,有开发者就定
程序是你写的,就由你决定
即:参数是按位置解释的

而 index.php?key1=val1&key2=val2
参数是按名称解释的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template