for loop counting issue in php -


i have 2 loop fetching questions database.questions associated parameter. there 3 parameters having different number of questions. doing is-

for($j=0; $j<count(parameter); $j++) {     echo parameter[$j]['name'];     for($m=0; $m<count($question); $m++) {         echo $m.'. '$question['description'];     } } 

its output is:

location

  1. correct address , contact details of asc, in company systems, website & sms tool , matching.
  2. contactability on landline & mobile no of asc

facilities

  1. ventilation, lighting, power backup & airconditioning of asc
  2. infotainment system
  3. drinking water & new paper

avm

  1. look & feel, color code of asc, parameters
  2. glow sign board
  3. uniforms
  4. notice board in waiting area per latest guidelines

location ,facilities,avm parameters having 2-3 questions listing 1,2 again 1,2,3 1,2,3,4 want 1,2,3,4 9 counting

try below code

$count = 1; for($j=0;$j<count(parameter);$j++){ echo parameter[$j]['name'];     for($m=0;$m<count($question);$m++){     echo $count.'. '$question['description'];     $count += 1;     } } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -