php 读取 Unicode 编码的txt 开头那两个问号乱码怎么删除?
PHP中文网
PHP中文网 2017-04-10 17:32:05
0
1
408

txt文件内容:

1399389180,10838,10842,10837,10842,242,1.311514E+07,0,0,5053,126152,0,0
1399389240,10842,10840,10840,10842,120,6504448,0,0,5061,126122,0,0
1399389300,10840,10841,10840,10841,40,2168064,0,0,5068,126096,0,0
1399389360,10840,10841,10840,10841,20,1084160,0,0,5072,126090,0,0
1399389420,10842,10841,10840,10842,102,5528832,0,0,5084,126128,0,0
1399389480,10841,10841,10840,10841,12,650496,0,0,5088,126132,0,0
1399389540,10842,10838,10838,10843,180,9757696,0,0,5110,126146,0,0

读出出来的结果,第一行总是多两个��,怎么把这个过滤掉?>

��1399389180,10838,10842,10837,10842,242,1.311514E+07,0,0,5053,126152,0,0 @D:\minute1_pp01temp\1.txt
1399389240,10842,10840,10840,10842,120,6504448,0,0,5061,126122,0,0 @D:\minute1_pp01temp\1.txt
1399389300,10840,10841,10840,10841,40,2168064,0,0,5068,126096,0,0 @D:\minute1_pp01temp\1.txt
1399389360,10840,10841,10840,10841,20,1084160,0,0,5072,126090,0,0 @D:\minute1_pp01temp\1.txt
1399389420,10842,10841,10840,10842,102,5528832,0,0,5084,126128,0,0 @D:\minute1_pp01temp\1.txt
PHP中文网
PHP中文网

认证0级讲师

全部回覆(1)
迷茫

针对第一行试试这个:

$line1 = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $line1);
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板