So I'm trying to get dynamic data from the $_POST array. The $_POST array looks like this after the form submit:
Array
(
[teams1member3] => on
[teams1member4] => on
[teams1member7] => on
[teams1member8] => on
[teams2member1] => on
)
Now I'm not entirely sure how I can access these, the teams can be any number and the same goes for a member. Is there a way to "read" the [teams1member3]
?
I tried looping through the $_POST variable with a foreach loop (foreach($_POST as $post)
), but this only gets the value (on
). If I'm able to get the teams1member3
, teams1member4
, etc. I should be able to continue.
Anyone that can help me out? Much appreciated!