How to read csv files and output them in php_PHP tutorial

WBOY
Release: 2016-07-13 10:03:19
Original
1051 people have browsed it

How to read and output csv files in php

This article describes the method of reading and outputting csv files in php. Share it with everyone for your reference. The specific implementation method is as follows:

<?php
$row = 0;
$j = 1; // Linea por la que quieres empezar
$file = "name.txt"; //Nombre del fichero
if (($handle = fopen($file, "r")) !== FALSE) {
 while (($data = fgetcsv($handle, ",")) !== FALSE) {
   print_r($data);
   $j++;
   $row++; 
 }
}
?>
Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/969330.htmlTechArticleHow to read csv files and output them using php. This article describes how to use php to read csv files and output them. Share it with everyone for your reference. The specific implementation method is as follows: ?php$row = 0;$j = 1; /...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template