<html>
<head>
</head>
<body>
<?php
$tekens = array('','a','b');
$linecounter = 0;
function genereer($tekens, $start, $aantaltekens) {
if($aantaltekens == 0) {
$linecounter++;
echo '<div>'.$linecounter.': '.$start.'</div>';
return;
}
foreach($tekens as $t) {
genereer($tekens, $start.$t, $aantaltekens-1);
}
}
genereer($tekens, '', 3);
?>
</body>
</html>
/*
tekens means characters, aantaltekens means number of chars, genereer means generate.
i want the number of the generated string before the string itself, and is should be seperate (i should be able to put things inbetween etc)
*/