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

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

问题描述

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

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



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



我不知道这件事是怎么发生的,所以如果我错过了,请让我知道。



感谢您的帮助!

解决方案

是的,使用user []作为键。应该管用。 PHP将所有$ _POST []变量存入数组?

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

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

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

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

Thanks for your help!

解决方案

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

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

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