php - For each loop to display input arrays set -
html:
<input type="date" name="employment_companyname[]"> <input type="date" name="employment_datefrom[]"> <input type="date" name="employment_dateto[]"> <input type="date" name="employment_mainduties[]">
php:
foreach( $employment_companyname $m => $employmentcompanyname ) { echo $employment_datefrom[$m]; echo $employment_dateto[$m]; echo $employmentcompanyname; foreach( $employment_mainduties[$m] $n =>$employmentmainduties) { echo $employmentmainduties; } }
job1
date - date to
company name
list of duties unique company name (depending on how many have added)
job2
date - date to
company name
list of duties unique company name (depending on how many have added)
job3 etc.
it prints out like:
job1
unique duties job1 , job2job2
unique duties job1 , job2
rather than:
job1
unique duties job1job2
unique duties job2
Comments
Post a Comment