Mailinglisten-Archive |
Hallo Jomo,
folgendes funzt bei mir super:
<?
$anzahl = 1000;
while ($anzahl > 0) {
$list = file("test.inc.php");
$anzahl = sizeof($list); // die anzahl der elemente dieses arrays
echo $anzahl."<br>";
mt_srand ((float) microtime() * 10100100);
$line = mt_rand(0,($anzahl-1));
$hostname = rtrim($list[$line]);
unset ($list[$line]);
$templist = implode ("", $list);
$lt = fopen("test.inc.php","w+");
if ($lt){
fwrite($lt, $templist);
fclose ($lt);
}
}
?>
Die einzigen Unterschiede sind die Anführungszeichen bei der
file()-Anweisung und die Schleife. Vielleicht hilft Dir diese Einschränkung
weiter.
Gruß,
Leo
php::bar PHP Wiki - Listenarchive