Home  >  Article  >  php教程  >  php读取csc文件并输出,

php读取csc文件并输出,

WBOY
WBOYOriginal
2016-06-13 09:03:521053browse

php读取csc文件并输出,

方法一:

<&#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;>

方法二:

$fh = fopen("contacts.csv", "r");
while($line = fgetcsv($fh, 1000, ",")) {
  echo "Contact: {$line[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