PHP计数器
来源:程序员人生 发布时间:2013-11-06 12:11:07 阅读次数:3261次
- <?php
- $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);
- ?>
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠