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 , job2

job2
unique duties job1 , job2

rather than:

job1
unique duties job1

job2
unique duties job2


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -