注册 登录
编程论坛 PHP技术论坛

为什么数组打印出来多个[3]=>

szchina 发布于 2013-03-07 12:10, 1502 次点击
285Array (    [0] => 2    [1] => 8    [2] => 5    [3] =>  ) Array (    [0] => 2    [1] => 8    [2] => 5    [3] =>  ) Array (    [0] => 2    [1] => 8    [2] => 5    [3] =>  ) Array (    [0] => 2    [1] => 8    [2] => 5    [3] => )



<?php
@$f=fopen("piccounter.txt", "r") or die("Unable to open file!");
$num=fread($f, filesize("piccounter.txt"));
$num++;
fclose($f);
$fw=fopen("piccounter.txt", "w");
fwrite($fw, $num);
fclose($fw);
echo $num;
$fr=fopen("piccounter.txt", "r");
$array_count=0;
while (!feof($fr)) {
$counter_array[$array_count]=fgetc($fr);
$array_count++;
}
foreach ($counter_array as  $value) {
print_r($counter_array);
}
fclose($fr);
?>
0 回复
1