方法一:
1
2
3
4
5
6
7
8
9
10
11
12
|
<?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 ++;
}
}
?>
|
方法二:
1
2
3
4
|
$fh = fopen ( "contacts.csv" , "r" );
while ( $line = fgetcsv ( $fh , 1000, "," )) {
echo "Contact: {$line[1]}" ;
}
|
以上所述就是本文的全部内容了,希望大家能够喜欢。