Mailinglisten-Archive |
Hai, habe es auf meine Weise geloest. Natuerlich mit kryptischen Variablennamen und ohne comments: <?php $AA = array('A','B','C','D','E'); $XX = array(); $EG = array(); $i = 0; foreach($AA as $n0 => $XX[0]) { $BB = $AA; unset($BB[$n0]); foreach($BB as $n1 => $XX[1]) { $CC = $BB; unset($CC[$n1]); foreach($CC as $n2 => $XX[2]) { $DD = $CC; unset($DD[$n2]); foreach($DD as $n3 => $XX[3]) { $EE = $DD; unset($EE[$n3]); foreach($EE as $n4 => $XX[4]) { $string = implode('', $XX); $EG[(sprintf('% 3s', $i))] = $string; $i++; } } } } } print_r($EG); ?> und dauert nur 7,5 Millisekunden, geht doch ... m. b. G. Norbert ------------------ mobil 0177-1741686 ------------------ e.o.m.
php::bar PHP Wiki - Listenarchive