- 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( '120',
'140',
'200',
'210',
'220',
'7',
'9',
'14',
'18',
'20',
'25',
'32',
'39',
'50',
'80',
'90',
'100',
'140',
'160',
'180',
'200',));