Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

He meant the name attributes on form elements.

When a form containing <input type="text" name="foo" value="bar"> is submitted, $_POST['foo'] === 'bar' in PHP. (And it works similarly for other server-side programming languages.)



That's true, but not at all what he means. He means:

 <input type="text" name="foo[bar][]" value="yaw" /> 
will result in:

 $_POST['foo'][0] === "yaw"; 
In other words you can have a form create multidimensional arrays.


I was merely replying to the “PHP does not have access to IDs of HTML elements” statement, but good job on the additional explanation.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact