Take the 2-minute tour ×  Ok so tbh the title isn't very good I
just don't know how to explain what i'm trying to do in 1 short
sentence so I will do my best here....  I have an array
$options = array('156656', 'bar', '235456','soft',
'353636','eve', '4356563', 'evil');  I want number and name to
be partnered/linked so have done this by splitting with list()
...  list($number, $name) = $options;   echo $name . ' : ' .
$number . '<br />';  which shows as   156656 : bar  but what I
need is for all to be listed like so ...  156656 : bar 235456 :
soft 353636 : eve 4356563 : evil  I'm guessing this is done with
a foreach but what ever I try fails  As always all help is
appreciated and thanks in advance.  share|improve this question
add comment  3 Answers  up vote 2 down vote accepted  You can
use array_chunk to get sub arrays like below:  $options =
array('1', 'bar', '2','soft', '3','eve', '4', 'evil'); foreach
(array_chunk($options, 2) as $sub) {      list($number, $name) =
$sub;       echo $number . ' : ' . $na