despite my efforts I wasn't able to find a suitable solution. Here is the problem:
All the data comes from a form with text fields named name[], gender[], and age[].
print_r($_POST) looks like:
[name] => Array ([2] => Adam [6] => Suzy )
[gender] => Array ( [2] => male [6] => female )
[age] => Array ( [2] => 30 [6] => 25 )
I am trying to iterate it like this:
foreach ($array as $value)
{
echo $value['name'].$value['gender'].$value['age']."<br>";
}
The result should look like this:
Adam - male - 30
Suzy - female - 25
arraystructure ?$arrayas you have it written will not parse. Is this your actual code? Are you asking how to define the array, or do you already have an array (somewhat) like what you've shown and you're asking how to iterate/output it?