bolstad / csv-parser
简单的系统,逐行解析CSV文件并发送数据到回调函数
0.2.3
2018-03-02 22:23 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-14 17:03:39 UTC
README
简介
一个简单的系统,用于逐行解析CSV文件并将数据发送到回调函数。
示例
use CsvParser\Simple; function handler ( $data ) { print_r( $data ); } /* Parameters for parseRowByRow: * @param string $filename File to parse * @param string $callback Callback function to send data to * @param int $line Length - Must be greater than the longest line (in characters) to be found in the CSV file (allowing for trailing line-end characters). * @param str $delimiter Set the field delimiter (one character only). * @param str $enclosure Set the field enclosure character (one character only) * @param type $escape Set the escape character (one character only). Defaults as a backslash. * @param bool $autoDetectHeader Try to auto detect header rows - if false, line 1 i always used * @return bool */ Simple::parseRowByRow('file.csv' ,'handler');
历史
2014-07-23 版本 0.1.3 - 快速修复,初始发布 2015-08-27 版本 0.1.4 - 更新README并添加示例代码 2018-03-02 版本 0.2.3 - 尝试自动检测文件第一行是否缺少正确的标题信息。 2024-03-05 版本 0.3.0 - 删除了auto_detect_line_endings
,因为它已被弃用