Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getCounter() {
- //selref00001
- $File = "counter.txt";
- $handle = fopen($File, 'c+') ;
- $data = fread($handle, 512) ;
- $count = (int)$data + 1;
- fseek($handle, 0) ;
- fwrite($handle, $count) ;
- $counter = sprintf("%05d", $count);
- return $counter;
- }
- echo "selref".getCounter();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement