Sr. PHP Programmer Question:

How to create an array of a group of items inside an HTML form?

Senior PHP Programmer Interview Question
Senior PHP Programmer Interview Question

Answer:

We can create input fields with same name for "name" attribute with squire bracket at the end of the name of the name attribute, It passes data as an array to PHP.
For instance :

<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyArray[]" />


Previous QuestionNext Question
Can you create a class in PHP?How will you create objects in PHP?