Hallo Harry,
danke für deine Antwort. Jetzt verstehe ich das ganze besser. Dann müsste das ganze aber so aussehen, sonst würde die Schleife erst gar nicht ausgeführt werden.
$rand = rand(10000,99999);
$datei = "themen/$rand.txt";
while(file_exists($datei)){
$rand = rand(10000,99999);
}
Also ist deine do - while Schleife tatsächlich besser.
Stimmt das so?
do {
$rand = rand(10000,99999);
$datei = "themen/$rand.txt";
} while (file_exists($datei));
mfg bonehunter