Looping through with double variables

Posted by Luke on Stack Overflow See other posts from Stack Overflow or by Luke
Published on 2010-05-29T11:51:32Z Indexed on 2010/05/29 12:02 UTC
Read the original article Hit count: 241

Filed under:

I have two arrays with two sets of values in ($a[] and $b[]) I want to do something like the following:

$a[0] - $b[0] $a[0] - $b[1]

$a[1] - $b[0] $a[1] - $b[1]

This will continue until the arrays reach the end. So i want a hyphen to seperate the two arrays, with the first array staying the same until the second array has looped through.

I am trying to get this in a dropdown with option value.

How could i achieve this? I never tried doing any loops with two varaibles like that before, I literally have no idea at all! Thankyou

© Stack Overflow or respective owner

Related posts about php