I have text boxes with a default value. I want to put them in array output as shown below.
P.S: I need the expected array output (shown below) for my dynamic options in my online quiz program when creating questions
if(isset($_POST['btn_submit'])
{
//code here
}
<form method="post">
//question 1 array index [0]
<input type="text" name="option" value="1">
<input type="text" name="option" value="2">
<input type="text" name="option" value="3">
//question 2 array index [1]
<input type="text" name="option" value="1">
<input type="text" name="option" value="2">
<input type="submit" name="btn_submit">
</form>
EXPECTED ARRAY OUTPUT VALUES:
array (
[0] => 1,2,3
[1] => 1,2
)
EDIT:
It's possible to have the same name but still gets the expected array value? then, put them in one variable array
option[0][]and for second oneoption[1][]with one more index.