I have the code below and I want the array
nome
to contain only the names of the lines that have checkbox
cb
checked.
<form action="" method="post">
<table>
<tr>
<td><input type="checkbox" name="cb[]" id="cb1" value="1"></td>
<td><input type="text" name="nome[]" id="nome1"></td>
</tr>
<tr>
<td><input type="checkbox" name="cb[]" id="cb2" value="1"></td>
<td><input type="text" name="nome[]" id="nome2"></td>
</tr>
<tr>
<td><input type="checkbox" name="cb[]" id="cb3" value="1"></td>
<td><input type="text" name="nome[]" id="nome3"></td>
</tr>
</table>
<input type="submit" value="enviar" name="enviar">
</form>
<?php
if (isset($_POST['enviar'])) {
var_dump($_POST['cb']);
var_dump($_POST['nome']);
}
?>