/**
* @description 迭代器读取csv文件
* @param $strCsvPath
* @return \Generator
*/
public static function readPathCsvFile($strCsvPath)
{
if ($handle = fopen($strCsvPath, 'r')) {
while (!feof($handle)) {
yield fgetcsv($handle);
}
fclose($handle);
}
}
/**
* @description 处理c单行信息
* @param $arrData
* @return \Generator
*/public static function dealCsvLineData($arrData = [])
{
$arrAfterData = [];
if (false === empty($arrData)) {
//去除每个字符串 前后空格
foreach ($arrData as &$colData) {
//检测对应编码格式 csv文件格式Shift-JIS