Say i start with a simple array (which could be theoretically of any length):
$ids = array(1,2,3,4);
What it the best solution for splitti
Fixed from my initial jump-the-gun suggestion of array_chunk()
array_chunk()
Try this instead:
$ids = array(1, 2, 3, 4); $out = array(); while ($item = array_shift($ids)) { foreach ($ids as $key=>$value) { $out[] = array($item, $value); } }