书上的一段PHP代码,有些想不通,能不能请高手解惑? 书上不一定就对,尤其是国内的书,呵呵比如漏了$str的赋值,以及int fopen ( string filename, string mode [, int use_include_path]) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 对不起,$str_array=expolde("||",$str);//这句我打错了。$str_array=expolde("||",$fd) 对不起,上面代码有些问题。从新写一下。主要是一个计数器,他是一段取得用户IP,进行判断,确定访问人数的增加。问题是在数组上的操作看不懂。部分代码如下:function counter(){ global $suerip; $counterFile="count.txt";//保存访问量信息文件 $fd=fopen($counterfile,"rw"); $str=fread($fd,100); $str_array=expolde("||",$str); while (list($key,$value)=each($str_arry)) { $count[$key]=$value; } fclose($fd); $num=$count[0]; $ip=$count[1]; $num=$num+1; $fd=fopen($counterfile,"w"); fputs($fd,$num||$userip"); fclose($fd); echo "$num"; //问题是str_array里在做expolde时已经取得了数组,直接用$str_array不就可以了,为什么还要做一个同样的$count数组?} 获取地址栏url中的域名 一个很奇怪的soap问题 php中如何添加一个panel方法? PHP 新手 请教(preg_replace正则式)!! .php3? 关于get for循环可以这样用吗? 一个表单的数据接收问题? 刚刚做的网站,大家批批 救急呀!各位高手谁用php编过实现在线出题的程序? IP 来源查找 PHP源码…… 请教在PHP里定义下窗口的问题
$str_array=expolde("||",$fd)
从新写一下。主要是一个计数器,他是一段取得用户IP,进行判断,确定访问人数的增加。问题是在数组上的操作看不懂。部分代码如下:
function counter()
{
global $suerip;
$counterFile="count.txt";//保存访问量信息文件
$fd=fopen($counterfile,"rw");
$str=fread($fd,100);
$str_array=expolde("||",$str);
while (list($key,$value)=each($str_arry))
{
$count[$key]=$value;
}
fclose($fd);
$num=$count[0];
$ip=$count[1];
$num=$num+1;
$fd=fopen($counterfile,"w");
fputs($fd,$num||$userip");
fclose($fd);
echo "$num";
//问题是str_array里在做expolde时已经取得了数组,直接用$str_array不就可以了,为什么还要做一个同样的$count数组?
}