Home >php教程 >php手册 >PHP计数器

PHP计数器

WBOY
WBOYOriginal
2016-06-13 09:59:541214browse

     
    
    $counterFile = "balong.txt";//存储数值的文件名几路径
    
    function displayCounter($counterFile) {
     $fp = fopen($counterFile,"rw");
     $num = fgets($fp,5);
     $num += 1;
     print "您是第 "."$num"." 个看巴泷计数器的家伙";
     exec( "rm -rf $counterFile");
     exec( "echo $num > $counterFile");
    }
    
    if (!file_exists($counterFile)) {
     exec( "echo 0 > $counterFile");
    }
    
    displayCounter($counterFile);
    
    ?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn