Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
170 views
in Technique[技术] by (71.8m points)

php - Can I have multiple $_GET with the same key, different values?

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...