I'm having two arrays of fields (id[], names[]) and I want to loop through one item each of the two array per time instead of looping through the complete cycle of id[] before looping through names[] using php
HTML Code
<input type="text" name="id[]" /> <input type="text" name="names[]" /></br>
<input type="text" name="id[]" /> <input type="text" name="nmaes[]" /></br>
<input type="text" name="id[]" /> <input type="text" name="names[]" /></br>
PHP Code
<?php
error_reporting( error_reporting() & ~E_NOTICE );
if($_POST['test']=='test')
{
foreach($_POST['id'] as $key => $value) {
echo "id $key = $value"."</br>";
}
foreach($_POST['names'] as $key => $value) {
echo "names $key = $value"."</br>";
}
}
?>
Thanks.