“"”也会错?!?! if(!file_exists("/tmp/count.txt")) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 改為:<html><head><title>first program</title></head><body><?phpfile_count();function file_count() { if(!file_exists("/tmp/count.txt")) { exec("echo 0 > /tmp/count.txt"); } $f_open=fopen("/tmp/count.txt","r+"); $f_size=filesize("/tmp/count.txt"); $count=fgets($f_open,$f_size+1); $count+=1; fseek($f_open,0); fputs($f_open,$count); fclose($f_open); echo"本页已有".$count."人浏览"; return $count; } ?></body></html>仔細比較吧 配置PHP5+APACHE2.2,竟然打不开php页面,而是下载,这是为什么? 如何在页面中显示树形结构? 求一个php留言板程序 匹配中括号中的内容的正则 【急】如何实现 php 服务器端 1个对象(单例模式)的问题! 如何设置PEAR? 有哪位配置过linux下的PHP啊? php中文显示问题 用php实现将excel到入mysql中??高人快来救我 php 求助大神 敬指点一下,关于php地址栏传递参数的问题。 斑竹!我的专家分怎么减少了?
<html>
<head>
<title>first program</title>
</head>
<body>
<?php
file_count();
function file_count()
{
if(!file_exists("/tmp/count.txt"))
{
exec("echo 0 > /tmp/count.txt");
}
$f_open=fopen("/tmp/count.txt","r+");
$f_size=filesize("/tmp/count.txt");
$count=fgets($f_open,$f_size+1);
$count+=1;
fseek($f_open,0);
fputs($f_open,$count);
fclose($f_open);
echo"本页已有".$count."人浏览";
return $count;
}
?>
</body>
</html>仔細比較吧