I’m wondering if there is a cleaner way to pass multiple variables in a GET request than the following:
http://www.mysite.com/somepage?tags[]=one&tags[]=two&tags[]=three
I had thought about the following:
http://www.mysite.com/somepage?tags=one,two,three
Then using explode() to separate them.
Wondered if anyone had seen or used a better solution though?
Using
explode()is only reliable if the values of each tag will never contain whatever string it is you’re exploding by (in this case “,”).I’d say it’s safer to use
tags[]=X&tags[]=Y.