Mailinglisten-Archive |
hallo,
ich weiß, eigentlich ist es kleinkram, aber ich habe gerade einen counter gemacht, der sich irgendwie für mich nicht nachvollziehbar
verhält...
<?php
$do_count = true;
// following code gets the counter from a file, increases it and writes writes it again
$log = "counter.log";
if($do_count){
$num=(file_exists($log))?(int)fread($id=_(at)_fopen($log,"r"),filesize($log)):0;
_(at)_fclose($id);
fwrite($id=fopen($log,"w+"),++$num);
fclose($id);
}
// following code gets the counter from a file and displays it
$num=(file_exists($log))?(int)fread($id=_(at)_fopen($log,"r"),filesize($log)):0;
fclose($id);
echo $num;
?>
bei jedem reload zählt der counter einen hoch. das soll auch so.
aber immer wenn er ein vielfaches von 10 ist, schluckt die ausgabe die letzte null.
bsp.: 1,2,3,4,5,6,7,8,9,1,11,12,13...
^^^
woran kann das liegen?
gruß
christian
_________________________________________________________
Do You Yahoo!?
Get your free _(at)_yahoo.com address at http://mail.yahoo.com
php::bar PHP Wiki - Listenarchive