Habe folgenden Code
[code]<?php
function count_out($file)
{
$array1 = file("./counter.txt"); // komplette Datei ausgelesen
foreach($array1 as $zeile)
{
$array2 = explode("|", $zeile);
if($array2[0] == $file)
{
$count = $array2[1];
$count = chop($count);
}
else
{
$count = "0";
}
}
return $count;
}
echo count_out($filename);
?>
[code]<?php
function count_out($file)
{
$array1 = file("./counter.txt"); // komplette Datei ausgelesen
foreach($array1 as $zeile)
{
$array2 = explode("|", $zeile);
if($array2[0] == $file)
{
$count = $array2[1];
$count = chop($count);
}
else
{
$count = "0";
}
}
return $count;
}
echo count_out($filename);
?>
Code:
bekomme folgende Fehlermeldung: Notice: Undefined variable: count in c:\apache\htdocs\test\downloadzähler\admin.php on line 18 Wenn die Datei Counter.txt Ler ist oder der filename nicht vorhanden ist soll er 0 ausgeben Andi
Kommentar