-1
Hello! My question is, can I work with more than two variables in isset and foreach?
have that code:
if(isset($_POST["produto"]) && $_POST["qtd"]){
echo "Ítens escolhidos:<BR>";
$table = '<table>';
$table .= '<thead>';
$table .= '<tr>';
$table .= '<td>Produto</td>';
$table .= '<td>Qtd</td>';
$table .= '<td>Valor</td>';
$table .= '</tr>';
$table .= '</thead>';
$table .= '<tbody>';
foreach(array_combine($_POST["produto"], $_POST["qtd"]) as $numero => $quantidade){
$table .= '<tr>';
$table .= "<td>{$numero}</td>";
$table .= "<td>{$quantidade}</td>";
// $table .= "<td>{$valor}</td>";
$table .= '</tr>';
}
$table .= '</tbody>';
$table .= '</table>';
echo $table;
}else {
echo "Você não preencheu o formulário ainda!<br>";
}
I want to insert the value field in isset and foreach, as the syntax?
You may call Clayton, see: https://answall.com/a/117504/3635
– Guilherme Nascimento