吳佳鑫
社會觀察者、社會企業家、教育創新者、遊戲人、媒體人、廚師,小人物與您分享眼見耳聞的生活大小事。
Anything will understand slightly a spot, life more color spots
$file = "00.csv";$openfile = fopen($file, "r");$cont = fread($openfile, filesize($file));echo $cont;
$row = 1;$datax=["0"];$handle = fopen("00.csv","r");while ($data = fgetcsv($handle, 1000, ",")) {$num = count($data);$row++; //跑每行for ($c=0; $c < $num; $c++) { //跑單筆array_push($datax,$data[$c]);}console_log($datax[$row]);}fclose($handle);
array_push($datax,$data[$c]);
console_log($datax[$row]);function console_log($output, $with_script_tags = true) {$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .');';if ($with_script_tags) {$js_code = '<script>' . $js_code . '</script>';}echo $js_code;}
<style>table, th, td {border: 1px solid black;border-collapse: collapse;}th, td {padding-top: 10px;padding-bottom: 20px;padding-left: 30px;padding-right: 40px;}</style><?php$row = 1;$datax=["0"];$handle = fopen("00.csv","r");while ($data = fgetcsv($handle, 1000, ",")) {$num = count($data);$row++; //跑每行for ($c=0; $c < $num; $c++) { //跑單筆array_push($datax,$data[$c]);}console_log($datax[$row]);}fclose($handle);function console_log($output, $with_script_tags = true) {$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .');';if ($with_script_tags) {$js_code = '<script>' . $js_code . '</script>';}echo $js_code;}echo "<br>";echo "<hr>";echo "<center>目前各號出現次數</center>";echo "<hr>";echo "<br>";echo "<table>";$answer = array_count_values($datax);for ($c=1; $c < 50; $c++) {if($c==1)echo "<tr>";else if ($c==11)echo "<tr>";else if ($c==21)echo "<tr>";else if ($c==31)echo "<tr>";else if ($c==41)echo "<tr>";echo "<td>";echo $c."號:".$answer[$c]. "次<br>\n";;echo "</td>";if($c==10)echo "</tr>";else if ($c==20)echo "</tr>";else if ($c==30)echo "</tr>";else if ($c==40)echo "</tr>";else if ($c==49)echo "</tr>";}echo "</table>";echo "<br>";echo "<hr>";echo "<center>歷史紀錄</center>";echo "<hr>";echo "<br>";echo "<table>";$row = 1;$datax=["0"];while ($data = fgetcsv($handle, 1000, ",")) {$num = count($data);$row++; //跑每行echo "<tr>";for ($c=0; $c < $num; $c++) { //跑單筆echo "<td>";array_push($datax,$data[$c]);echo $data[$c];echo "</td>";}console_log($datax[$row]);echo "</tr>";}fclose($handle);echo "</table>";?>