首页 >后端开发 >php教程 >PHP计数器_PHP教程

PHP计数器_PHP教程

WBOY
WBOY原创
2016-07-13 16:54:22794浏览

     
    
    $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);
    
    ?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631774.htmlTechArticle?php $counterFile = "balong.txt";//存储数值的文件名几路径 function displayCounter($counterFile) { $fp = fopen($counterFile,"rw"); $num = fgets($fp,5); $num += 1; print "您...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn