0
Good afternoon. I’m having trouble showing the data of a form, where they can have multiple addresses and within those addresses can have several involved. I tried something like:
foreach($input[endereco] as $key => $endereco){
foreach($input[envolvidos] as $envolvidos){
echo $endereco.' - '$envolvidos[$key].'<br>';
}
}
But so, if you have 2 addresses, will show only 2 involved and will not matter if it is from the first registration or the second .
your code is correct? should not close the
foreach
??– rLinhares
no error of syntax friend
– Luiz Gustavo Costa Ceolin
now no more :P
– rLinhares
$input[endereco]
will give syntax error, assuming thatendereco
is not an application constant.– Woss
i use Laravel and $input[field] is something I can use
– Luiz Gustavo Costa Ceolin
How would it have to be? I couldn’t get it right.
– Sam
You could give a
print_r($input)
to see how this array looks?– Andrei Coelho
I ended up choosing to use the register in another way, because the way I was doing, it wasn’t going to work. When debugging the $input variable, it showed several arrays
– Luiz Gustavo Costa Ceolin