• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP: Possible to pass array through URL?

you can do page.php?myvar[]=content1&myvar[]=content2&myvar[]=content3

not sure of the exact syntax...its been a while

you can also serialize the array and then rawurlencode it and pass it as a single variable
then you decode it and unserialize it
 
I don't know how php handles this, but the http spec says that you can send multiple parameters with the same name à la: ?foo=bar1&foo=bar2&foo=bar3

The java servlet api allows you to access a collection of values for a single parameter name (along with another option that simply picks the first one, in case you're only expecting one). Hopefully php does something similar. So I'd try sending multiple things with the same name and see what php does.

<edit>Oh, this looks pretty similar to troytime's suggestion...</edit>

Or, using your example with the commas, you could just send that, retrieve the value as one big string and then split it yourself.
 
It's hard to say without more context, but since it sounds like you control both the "sending" and "receiving" pages it seems like this could be more easily accomplished with session variables.
 
Back
Top