3 ms·
Doesn't support multiple keys with the same name, which is valid and not particularly uncommon. I wouldn't be surprised if it breaks in other ways. This kind of
by staunch 16y ago
Doesn't support multiple keys with the same name, which is valid and not particularly uncommon. I wouldn't be surprised if it breaks in other ways. This kind of thing is always full of subtle pitfalls.
- aarlo 16y agomultiple keys with the same name? what do you mean? arrays?
- melvin 16y agoI think he means duplicate keys, as in '?id=4&color=8&id=6'
- natrius 16y agoThere's no such thing as parameter arrays. Any parameter name can have multiple values. PHP just happens to turn those into arrays. (I've never tried it in PHP with a parameter name that didn't have brackets at the end. It might not work in PHP.) If you're familiar with Django, this is why the GET, POST and other request dictionaries are actually MultiValueDicts. If you call request.GET.getlist('varname') instead of request.GET['varname'], you'll get a list of each value passed with that name. The brackets aren't special, and if you used them, you'd need request.GET.getlist('varname[]').
- foobar2k 16y agoYou'd normally use this script when you were in full control of the parameters you are passing, so its fairly easy to avoid this situation.