ob_start();
session_start();
$num=0;
$dirpt = "在线";
$reftime = 1;
if (is_dir($dirpt) && $dir = opendir($dirpt)) {
while (($file = readdir($dir)) !== false) {
if(strcmp($)文件,"..")==0 || strcmp($file,".")==0){
继续;
}
$D_[日期("年月日 H:i:s ",filemtime($dirpt."/".$file))]=$file;
$num ;
unset($cum);
}
closeir($dir);
$filename = session_id();
$fp = fopen($dirpt."/".$filename,"w");
fputs($fp,"");
fclose($fp );
$ntime = date("Y-m-d H:i:s",mktime(date("H"),date("i")-1,0,date("m"),date ("d"),date("Y")));
$D_[$ntime]="-";
krsort($D_);
$onlinenumber=0;
while (1){
$vkey=key($D_);
$onlinenumber ;
if(strcmp($ntime,$vkey)==0){
中断;
}else {
array_shift($D_);
}
}
array_shift($D_);
重置($D_);
while(count($D_)>0) {
$ckey=key($D_);
unlink($dirpt."/".$D_[$ckey]);
if(!next($D_)){
中断;
}
}
}else{
@chmod("..",0777);
@mkdir($dirpt,0777);
}
$online=$onlinenumber-1;
$retime=60*$reftime;
echo "当前在线$online强>人";
ob_end_flush();
?>