note 15644 added to function.count
| From: | suitcaseman at aon dot at | Date: | Mon, 24 Sep 2001 23:28:15 +0000 |
| Subject: | note 15644 added to function.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18259@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
?>
--
http://www.php.net/manual/en/function.count.php
http://master.php.net/manage/user-notes.php?action=edit+15644
http://master.php.net/manage/user-notes.php?action=delete+15644
http://master.php.net/manage/user-notes.php?action=reject+15644