3 ms·
multiple keys with the same name? what do you mean? arrays?
by aarlo 16y ago
multiple 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[]').