<meta charset="utf8"><?php$count_f = fopen("jishu.txt","r");$strl = fgets($count_f,10);$str...
<meta charset="utf8">
<?php
$count_f = fopen("jishu.txt","r");
$strl = fgets($count_f,10);
$strl++;
fclose($count_f);
$count_f = fopen('jishu.txt', 'w');
fwrite($count_f,$strl);
//把$strl写入文件$count_f
fclose($count_f);
/*自动变成9位。*/
$len1 = strlen($strl);
$bit9 = '000000000';
$len2 = strlen($bit9);
$len1_2 = $len2 - $len1;
$add_zero = substr($bit9,0,$len1_2);
$snum = $add_zero.$strl;
echo "你是第".$snum."个访客。";
?>
学员评论
夏爱莲2016-09-23
你感兴趣的课程