アットウィキロゴ

PHS 01 国勢調査

<html>
<head>
<title>PHP Stream 01 国勢調査</title>
</head>
<body>
<img src="14.JPG">
<BR>
<BR>
<B>PHP Stream 01 国勢調査</B>
<BR>
<BR>
<?php
$handle = fopen("data01.csv", "r");
$n = 1;
while *1 !== FALSE) {
   for ($c=0; $c < 3; $c++) { 
$data[$n] = $csvdata[$c];
$n = $n +1;
}
}
fclose($handle);
for ($age=0; $age < 100; $age++) {
$skip=floor($age/5);
$m = 3*(3+ $age + $skip)-1;
$startm[$age] = $data[$m];
}
for ($age=0; $age < 100; $age++) {
$skip=floor($age/5);
$m = 3*(3+ $age + $skip);
$startf[$age] = $data[$m];
}
$fh=fopen("gdata01.csv","w");
for ( $age=0; $age<=99; $age++ ){
fwrite($fh,$age);
fwrite($fh,",");
fwrite($fh,$startm[$age]);
fwrite($fh,",");
fwrite($fh,$startf[$age]);
fwrite($fh,"\n");
}
$time2 = microtime();
$time = $time2 - $time1;
print "01 国勢調査の計算は完了しました。計算時間は";
print ($time);
print "秒です。";
print "5秒後に計算結果が表示されます。";
?>
<META HTTP-EQUIV="REFRESH" CONTENT = "5; URL=stream01.html" >
</body>
</html>
最終更新:2009年04月30日 09:13