3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createCombinations($input, $length) { foreach($input as $c) { if($length == 1) { return $c; } else { foreach(createCombinations($input, $length -1) as $s) { return $c + $s; } } } } $texte = "abcdefghijklmnopqrstuvwxyz0123456789"; $input = str_split($texte ); echo createCombinations($input, 4);

preferences:
40.95 ms | 402 KiB | 5 Q