PDA

View Full Version : multidimensional arrays in html forms


nassau
2006-10-31, 12:38
Hi, i'm planning to make use of multidimensional arrays in html forms. the question is, do all browsers support them and also, does PHP $_POST receive them?

it would look something like this in the form:<input type="text" name="role[expirationtime][]" />
<input type="text" name="role[expirationtime][]" />

<input type="text" name="role[content][]" />
<input type="text" name="role[content][]" />


:)

Brad
2006-10-31, 12:53
Browsers don't do anything with them. Remember, to the browser, it's all just markup.

PHP, though, will indeed treat them as entires in an array like you expect. I regularly use code like that.

nassau
2006-10-31, 12:59
ok, that's what i thought, just wanted to make sure. you never know with IE etc... but i get the point with how it's all markup to browsers.

thanks brad!