problem mit fopen
Verfasst: 15.03.2004 00:11
kann mir mal einer helfen? Was is hier falsch:
Fehlermeldung: Parse error: parse error, unexpected T_VARIABLE in *gekürzt*/test.php on line 5
Code: Alles auswählen
<?php
$EggFile = "./partner/parkrocker.txt"; // Name (evtl. inkl Pfad) des eggdrop-Files... z.b. /usr/local/eggy/eggy.txt
$fp = fopen("$EggFile", "r");
$count = 0;
while (!feof($fp)) {
$curr = trim(fgets($fp, 4096));
$curr = ltrim($curr, '~&@%+');
if ($curr != '') {
if (strlen($curr) > 16) {
$chatterz[$count++] = substr($curr,0,12).'...';
} else {
$chatterz[$count++] = $curr;
}
}
fclose($fp);
$anzahl = count($chatterz);
if ($anzahl == 0) {
srand((float) microtime() * 10000000);
$input = array ('Niemand im Chat :(', 'Chat ist leer', 'Keine Chatterz :(');
$rand_key = array_rand($input);
$out = $input[$rand_key];
} else if ($anzahl == 1) {
$out = 'Eine Person im Chat:<br><b>'.$chatterz[0].'</b>';
} else {
$out = $anzahl.' Uniboarder im Chat:<br><b>';
natcasesort($chatterz);
$out .= implode(', ', $chatterz).'</b>';
}
} else {
$out = '<!-- Kann das Eggdrop-Chatterlist-File nicht finden!!! Bitte Konfiguration nochmals überprüfen... -->';
}
?>