Re:Simple Way to Extract GET Params from a JavaScript Script...
by aarlo on Friday June 11, 2010 @10:23PM
(#1425431)
multiple keys with the same name? what do you mean? arrays?
[ Parent
| on HN ]
Re:Simple Way to Extract GET Params from a JavaScript Script...
by natrius on Friday June 11, 2010 @11:30PM
(#1425495)
There'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[]').