define ("pocet", "pocitadlo.txt");
if (file_exists(pocet))
{
$soubor=fopen(pocet, "r+");
$stav=fread($soubor, 10);
}
else
{
$soubor=fopen(pocet, "w");
$stav=0;
}
rewind($soubor);
fwrite($soubor,++$stav,10);
fclose($soubor);
$strnum = "$stav";
for($i = 0; $i < strlen($strnum); $i++)
{
$num = substr("$strnum", $i, 1);
echo " ";
}
?> |