foreach ($_GET['first_name'] as $first_name) {
echo $first_name . '<br>';
}
foreach ($_GET['surname'] as $surname) {
echo $surname . '<br>';
}
foreach ($_GET['age'] as $age) {
echo $age . '<br>';
}
foreach ($_GET['gender'] as $gender) {
echo $gender . '<br>';
}
The code above returns:
All firstnames
All surnames
All ages
All genders
I want it to look like this:
Firstname Surname
Age
Gender
...
[next person]
I have tried to resolve it this way:
$names = array_combine($_GET['first_name'], $_GET['surname']);
foreach($names as $firstname => $surname) {
echo $firstname . ' ' . $surname . '<br>';
}
This would fix my problem for firstname and surname but I still wouldn't know how to handle the other arrays.