-2
This is my multidimensional array:
<?php
$beneficiarios = array
(
array(
"codigo_membro" =>$cod,
"nome" => $_POST['nome1'],
"n_identificacao" => $_POST['n_identificacao1'],
"parentesco" => $_POST['parentesco1'],
"telefone" => $_POST['telefone1'],
"email" => $_POST['email1']
),
array(
"codigo_membro" => $cod,
"nome" => $_POST['nome2'],
"n_identificacao" => $_POST['n_identificacao2'],
"telefone" => $_POST['telefone2'],
"email" => $_POST['email2']
)
);
?>
I would like to read the elements within each array in the multidimensional array.
For example: I would like to be able to print what is written 'name' for each array.
I believe a loop of repetition might apply, but I’m out of ideas tried:
<?php echo $beneficiarios[0][1]?>
But you’re making a mistake.
And so:
<?php echo $beneficiarios[0]['nome']?>
?– Roberto de Campos
https://ideone.com/LV5eu8
– Roberto de Campos
Thank you very much... So far it works (ideone.com/Lv5eu8 ), but I would like to be able to print all the information of each array through the positions of the same.. thank you in advance.
– LUIS AMBROSIO