note 15644 deleted from function.count by philip
| From: | philip@php.net | Date: | Fri, 13 Dec 2002 00:27:14 +0000 |
| Subject: | note 15644 deleted from function.count by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40834@lists.php.net to get a copy of this message | ||
some usefull thingy for the count command - best used as a PI counter
(needs to be included in every viewable files)
<?php
$file = "dummy.xxx"; //need to be created before using the script, choose any filename
and extension (file must be chmode to 777)
$ftp = @fopen($file,"r+");
$count = (int)fgets($ftp,15); //to use more than 15 digits, the only thing to do is change it in
whatever
$count++;1
rewind($ftp);
fwrite($ftp,$count);
fclose($ftp);
include($file); //leave this option, if u don't want to show the file data
?>