时间:2021-07-01 10:21:17 帮助过:8人阅读
$fn = 'Order_2015-12-01_113045.csv';$s = file_get_contents($fn);preg_match_all('/[\x00-\x1f]/', $s, $m);print_r(array_map('bin2hex', $m[0]));Array ( [0] => 0a [1] => 0d [2] => 0a [3] => 0d [4] => 0a [5] => 0a )
function lazada_csv_import($filePath){ $file_txt=""; $fp = fopen($filePath, 'r'); while($buf = fgetcsv($fp, '"', ';')){ $file_txt .= implode("\t",$buf)."\t\n"; } return $file_txt;}
现在输出txt文件多了一行,用notepad++看是有多了一个换行符的,请问怎么查这个换行符是什么??
str_replace(array("\r\n", "\r", "\n"), " ", $buf[10]); 搞定了