Home >Backend Development >PHP Tutorial >How to read csv files and output them in php_PHP tutorial

How to read csv files and output them in php_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:03:45925browse

How to read csv files and output them in php,

The example in this article describes how to read and output csv files in php. Share it with everyone for your reference. The specific implementation method is as follows:

<&#63;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++; 
 }
}
&#63;>

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/967748.htmlTechArticleHow to read csv files and output them in php. This article describes how to read csv files and output them in php. Share it with everyone for your reference. The specific implementation method is as follows: php$row = 0;$j = 1;...
Statement:
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