[nycphp-talk] Re: Passing array elements as... strings?

Tom Melendez tom at
Thu Jan 4 14:00:30 EST 2007

On 1/4/07, Nate Abele <nate at> wrote:
> Two solutions that come to mind are to (a) parse out the var name and
> the index from the string, or (b) submit the var name and the index
> as two separate POST vars.  Any reason either of those wouldn't work?

That's what I came up with too.
$key = "bar[1]";
print $myarray[$index];

Very interested in other solutions.  If bar comes in as an array (like
$_POST[bar][1]) you could probably use array_keys to suck out keys,
although I haven't tried it.


More information about the talk mailing list