11
08月
2015
23. 查看 CSV 文件
1
2
3
4
5
6
7
8
|
function readCSV( $csvFile ){
$file_handle = fopen ( $csvFile , 'r' );
while (! feof ( $file_handle ) ) {
$line_of_text [] = fgetcsv ( $file_handle , 1024);
}
fclose( $file_handle );
return $line_of_text ;
}
|
语法:
1
2
3
4
5
|
<?php
$csvFile = "test.csv" ;
$csv = readCSV( $csvFile );
$a = csv[0][0]; // This will get value of Column 1 & Row 1
?>
|
特殊说明,本文版权归 ning个人博客 所有带原创标签请勿转载,转载请注明出处.