欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP计数器_PHP教程

程序员文章站 2024-01-07 18:11:16
...
$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 "您...

上一篇:

下一篇: