[Resolvido] Como criar um looping dentro de uma variavel!
Ola pessoal, estou tendo uma dificuldade em fazer o seguinte:
Tenho um formulario que contem 3 inputs(que podem ser adicionados dinamicamente) que serao arrays;
Apos preencher o formulario ele e enviada as informações para o email cadastrado;
meu problema é que eu crio o codigo html(do email) dentro de uma variavel e dentro dessa variavel eu preciso criar um looping para mim poder colocar as informações que estao armazenadas dentro dos arrays!!
Abaixo tem mais ou menos o codigo que eu gostaria de fazer!!
Desde Ja Agradeço.
$configuracao_da_mensagem_original="
<body style=\"padding:0; margin:0;\">
<div >
<table width=\"600\" border=\"0\" align=\"center\">
<tr>
<th colspan=\"2\" scope=\"col\"><img src=\"/imgs/logo.png\" width=\"130\" height=\"128\" style=\"margin: 0 235px;\" /></th>
</tr>
<tr>
<td colspan=\"2\" style=\"text-align: center; font-weight: bold; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: 24px; color: #006700;\">Nova proposta de sócio</td>
</tr>
<tr>
<td width=\"295\"> </td>
<td width=\"295\"> </td>
</tr>
<tr>
<td colspan=\"2\" style=\"font-weight: bold; color: #006700;\">Nome: <span style=\"color: #333\">$Nome</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\">Naturalidade: <span style=\"color: #333\">$Naturalidade</span></td>
<td style=\"font-weight: bold; color: #006700;\">Data de Nascimento: <span style=\"color: #333\">$Nascimento</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\">RG: <span style=\"color: #333\">$RG</span></td>
<td style=\"font-weight: bold; color: #006700;\">CPF: <span style=\"color: #333\">$CPF</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\">Estado Civil: <span style=\"color: #333\">$ECivil</span></td>
<td style=\"font-weight: bold; color: #006700;\">Profissão: <span style=\"color: #333\">$Profissao</span></td>
</tr>
<tr>
<td colspan=\"2\" style=\"font-weight: bold; color: #006700;\">Filiação: <span style=\"color: #333\">$Filiacao</span></td>
</tr>
<tr>
<td colspan=\"2\" style=\"font-weight: bold; color: #006700;\">Endereço: <span style=\"color: #333\">$Endereco</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\">CEP: <span style=\"color: #333\">$CEP</span></td>
<td style=\"font-weight: bold; color: #006700;\">Bairro: <span style=\"color: #333\">$Bairro</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\">E-mail: <span style=\"color: #333\">$Email</span></td>
<td style=\"font-weight: bold; color: #006700;\">Telefone/Celular: <span style=\"color: #333\">$Telefone</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\"> </td>
<td style=\"font-weight: bold; color: #006700;\"> </td>
</tr>
<tr>
<td colspan=\"2\" style=\"text-align: center; font-weight: bold; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: 24px; color: #006700;\">Informação dos dependentes</td>
</tr>
"
?>
<?php
$contagemarray = count($DNome);
for ($i=0; $i < $contagemarray; $i++){
echo
"
<tr>
<td colspan=\"2\" style=\"font-weight: bold; color: #006700;\">Nome: <span style=\"color: #333\">".$DNome[$i]."</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\">Grau de Parentesco: <span style=\"color: #333\">".$DParentesco[$i]."</span></td>
<td style=\"font-weight: bold; color: #006700;\">Data de Nascimento: <span style=\"color: #333\">".$DNascimento[$i]."</span></td>
</tr>
<tr>
<td style=\"font-weight: bold; color: #006700;\"> </td>
<td style=\"font-weight: bold; color: #006700;\"> </td>
</tr>
";
}
?>
<?php
"
</table>
</div>
</body>
";Discussão (4)
Carregando comentários...