how to loop through this ? / 2 arrays, intersect, loop

Discussion in 'PHP' started by johansonevr, Feb 24, 2010.

  1. #1
    hi there,
    The variable $isect is the intersection point of the 2 arrays $key, and $tdc
    $key contains the values from which i want $tdc to be splited into smaller chunks.
    one array(let's call it result) for values in $tdc[$key[0]] to $tdc[$key[1]] and so on to the end of values(keys) in $key. /Hope i made it clear.
    I've tryed for loop , foreach loop, while loop.
    So far i came with this working piece of code.
    How to loop through this ?
    
    for($i=$isect[10];$i<$isect[11];$i++){
    $table1[]=$tdc[$i];
    }
    
    Code (markup):

     
    Last edited: Feb 24, 2010
    johansonevr, Feb 24, 2010 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    hopefully the indexes from your arrays are static or the whole process will be mess.

    you already use looping structures, isnt it working?? what format of array you like to come up to.?
     
    bartolay13, Feb 25, 2010 IP