Custom Increment by given array in php -


i have array

array ( [0] => f [1] => f [2] => n [3] => ) 

how run 2 loops above array ?

for ($x = 0; $x <= 2; $x++) {     //in loop need output above              f-01             f-02     } 

i have loop im fetching data in like

for ($x = 0; $x <= 1; $x++) { //in loop need output above           n-01  } 

for on need below

<?php  $myarray = array ( 'f' ,'f' ,'n' , 'l');  $j =0;  for($x = 0; $x < 2; $x++ ){   echo $myarray[$x].'-'.$j.$x;  echo "<br>"; } echo "<br>";   $m=0; for($k=2;$k<=3;$k++){   echo $myarray[$k].'-'.$j.$m;     echo "<br>"; }  ?> 

i hope you.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -