From a form like this:
<form action="action.php" method="POST">
Foo: <input type="text" name="foo"><br>
<input type="submit" value="Submit">
</form>
We know that to classically access the information received by the method POST
of php
is:
$_POST['foo']
That internally it would be something like this:
/*arreglo obtenido por el método POST*/ [
'foo' => 'bar'
]
Now, what should I modify in the html
tags to receive something like this?
[
'name' => 'example of name',
'activities' => [
'0' => [
'activity' => 'eat'
'time' => '15:45:12'
'reason' => 'some explanations'
]
'1' => [
'activity' => 'sleep'
'time' => '21:07:12'
'reason' => 'some explanations'
]
//Se repite N número de veces
]
'rpe' => 'example of rpe',
'occupation' =>
]
Bearing in mind that the form (being dynamic) I generate it with JavaScript
.
NOTE : I want to know what I have to modify in the html
tags and how to access the information, ignoring the generation of my form; Any example that has the essence of what I want to achieve, is fine.
Greetings.