php - reset key count in array -


i have array this:

array{     10 - 2011 headlight assembly nissan versa      11 - lh 07-11 ins qtly o.e.m - free same day shipping      12 - 000      13 - a0      14 - 40626a1      15 - $165 actual      16 - more desc stuff } 

that produced simple dom result. there multiple items within list. reset key 10 after 17 reached can loop on results within array , find proper values without having keys 10, 14, 15 - , keys 20, 24, 25, etc.

not quite sure if have explained correctly, or how accomplish it. guidance appreciated. in advance!

well, indexes deny suggest tu use array of these indexes. , loop through array 10 16 , come 10, suggest this

$indexes_to_deny = [14,15,16]; $index = 10; while( condition stop loop ) {      if($index%17===0)       $index = 10;     if(in_array($index,$indexes_to_deny))     {       $index++;       continue;      }      /*         code here          can access items inside array $array[$index]     */       $index++: } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -