我可以有多个具有相同键、不同值的 $_GET 吗? [英] Can I have multiple $_GET with the same key, different values?

查看:22
本文介绍了我可以有多个具有相同键、不同值的 $_GET 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从相同 $_GET 具有不同值的 url 中检索参数?

Is it possible to retrieve the arguments from a url where the same $_GET has different values?

www.domain.com/?user=1&user=2

目前这只显示第二个列出的内容,所以如果我 echo $_GET['user'],它会输出 2

Currently this only shows whatever is listed second, so if I echo $_GET['user'], it would output 2

我似乎在 SO 上找不到这个,所以如果我错过了,请告诉我.

I couldn't seem to find this on SO, so if I missed it please let me know.

感谢您的帮助!

推荐答案

是的,使用 user[] 作为键.应该管用.PHP 将所有 $_POST[] 变量访问到一个数组中?

Yes, use user[] as key. should work. PHP access all $_POST[] variables into an array?

这篇关于我可以有多个具有相同键、不同值的 $_GET 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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