Спасибо. То что нужно
(Добавление)
Код этот. Возможно кому не будь да пригодится
PHP:
скопировать код в буфер обмена
function permuteUnique($items, $perms = [], &$return = []) { $return[] = $perms; } else { $prev = false; for ($i = count($items) - 1; $i >= 0; --$i) { $newitems = $items; if ($tmp != $prev) { $prev = $tmp; $newperms = $perms; permuteUnique($newitems, $newperms, $return); } } return $return; } } $permutations = permuteUnique (array('a', 'b', 'c'));
|