- array_shift: documentation ( source)
<?php
function permutation(array $arr)
{
while($ele=array_shift($arr))
{
$x=$ele;
echo $x."\n";
foreach($arr as $rest)
{
$x.=" $rest";
echo $x."\n";
}
}
}
permutation(
array
(
'0' => 'Lose Weight',
'1' => 'Gain Muscle',
'2' => 'Tone & Increase Muscle Definition',
'3' => 'Increase Endurance',
'4' => 'Improve Athletic Performance',
)
);