以下是php对csv文件的读取,写入,输出下来源gao@daima#com搞(%代@#码网载操作进行了详细的分析介绍,需要的朋友可以过来参考下
代码如下:
<?php
$file = fopen(‘text.csv’,’r’);
$file = fopen(‘text.csv’,’r’);
while ($data = fgetcsv($file)) { //每次读取CSV里面的一行内容
//print_r($data); //此为一个数组,要获得每一个数据,访问数组下标即可
$goods_list[] = $data;
}
//print_r($goods_list);
echo $goods_list[0][1];
fclose($file);
?>
以上就是php对csv文件的读取,写入,输出下载操作详解的详细内容,更多请关注gaodaima搞代码网其它相关文章!