<?php $temp = array("one","two","three","four","five"); $arrayResult = array(); for($i = 0; $i< count($temp); $i++){ for($j = 0; $j< count($temp) - $i; $j++){ $tempArr = $temp; $newArray[$i+1] = '*'; array_splice($tempArr,$j, $i+1,$newArray); $arrayResult [] = $tempArr; } } print_r($arrayResult);
You have javascript disabled. You will not be able to edit any code.