PHP教程.应用实例3
类别: PHP教程
PHP计数器
<?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);
?>
<?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);
?>
- 上一篇: PHP教程.应用实例4
- 下一篇: PHP教程.应用实例2
-= 资 源 教 程 =-
文 章 搜 索