'.$start.''; return; } foreach($tekens as $t) { genereer($tekens, $start.$t, $aantaltekens-1); } } genereer($tekens, '', 3); ?> /* 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) */