国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php從csv文件讀取數(shù)據(jù)并輸出到網(wǎng)頁的方法

Original 2017-02-07 11:00:39 314
abstract:本文實例講述了php從csv文件讀取數(shù)據(jù)并輸出到網(wǎng)頁的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:<?php $fp = fopen('sample.csv','r') or die("can't open file"); print "<tab

本文實例講述了php從csv文件讀取數(shù)據(jù)并輸出到網(wǎng)頁的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

<?php
$fp = fopen('sample.csv','r') or die("can't open file");
print "<table>\n";
while($csv_line = fgetcsv($fp)) {
  print '<tr>';
  for ($i = 0, $j = count($csv_line); $i < $j; $i++) {
    print '<td>'.htmlentities($csv_line[$i]).'</td>';
  }
  print "</tr>\n";
}
print '</table>\n';
fclose($fp) or die("can't close file");
?>

更多關(guān)于php從csv文件讀取數(shù)據(jù)并輸出到網(wǎng)頁的方法請關(guān)注PHP中文網(wǎng)(m.miracleart.cn)其他文章!

Release Notes

Popular Entries