1
good afternoon, I have this array coming from variables $form
Array
(
[nome] => 765hygfy
[data_nascimento] => ftyftyf
[email] => [email protected]
[sexo] => Feminino
[rg] => ytfytfyt
[cpf] => fytfty
[telefone_residencial] => fty
[telefone_celular] => fyt
[telefone_recado] =>
[cep] => fytf
[estado] => MS
[cidade] => fytfytf
[bairro] => ytf
[logradouro_rua] => ftyf
[numero] => tyfyt
[complemento] => fty
[referencia] => fytf
[onde_conheceu] => FaceBook
[revendeu_outras_marcas] => Não
[quais] => ytftyf
[horario_de_contato] => Manhã
)
they are coming from a form like the Names in this pattern
form[nome]
form[email]
and so it goes
what I need to do is php read this array by printing the key after value I’ve done several foreach until a go and turn blank.
my foreach
foreach($_POST['form'] as $key => $value){
$nome = arrumanome($key);
$msg.= $nome.": ".$value."<br>";
}
he only back Aki
:
:
:
:
:
:
:
:
What do you mean come back blank? What about the foreach structure?
– JuniorNunes
edited with my foreach and q back
– Jasar Orion
That way, it would be better to do 2
foreach
: one with$_POST
and the internal with the$value
– William Aparecido Brandino
can put html code too?
– Asura Khan
Takes the
['form']
of$_POST
offoreach
and see what returns.– Diego Souza
look I did a var_dump of $_POST and it returns all variables and var_dump of $_POST['form'] and back the array right as I put in msg up there but the foreach is not printing the key or value.
– Jasar Orion
Check the browser console and see if your server is not re-loading the page.
– ShutUpMagda
How is the HTML part? Would it be Ajax or Normal Form? Or the call is being made via Webservice?
– Guilherme Nascimento