Rumah  >  Artikel  >  pembangunan bahagian belakang  >  一个简单计数器的源代码_PHP教程

一个简单计数器的源代码_PHP教程

WBOY
WBOYasal
2016-07-21 16:02:49928semak imbas


$memo_file="phpcount/vst.txt";
if ($phpxcount$REMOTE_ADDR){
$visits = file($memo_file);
$number_of_last_visit = $visits[0];
$number_of_new_visit = ++$number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);

$len_str = strlen($number_of_new_visit);
for($i=(0);$i$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "一个简单计数器的源代码_PHP教程";
}
}else{
$visits = file($memo_file);
$number_of_last_visit = $visits[0];
$number_of_new_visit = $number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);

$len_str = strlen($number_of_new_visit);
for($i=(0);$i$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "一个简单计数器的源代码_PHP教程";
}
}
echo $output_str;
?>   

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316438.htmlTechArticle? $memo_file=phpcount/vst.txt; if ($phpxcount$REMOTE_ADDR){ $visits = file($memo_file); $number_of_last_visit = $visits[0]; $number_of_new_visit = ++$number_of_last_visit; $fp = fop...
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn