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
$ids = array(1,2,3,4); $result=array(); foreach($ids as $value_1) { foreach($ids as $value_2) { if($value_1 !=$value_2) { $result[]=array($value_1,$value_2); } } } echo ""; print_r($result);
"; print_r($result);