日期:2014-05-17  浏览次数:20480 次

求教php读取文件问题
数据是:
YX1206=YX1206,524.00,525.00,520.00,520.00,392,1050,523.00,543,2049,527.00,520.00,524.00,-4.00,1660,7664,870182.00,560.00,487.00YX1209=YX1209,545.00,547.00,552.00,551.00,6893,256324,552.00,6603,117688,553.00,546.00,549.00,7.00,1308386,452116,718696576.00,583.00,506.00SW1209=SW1209,61.00,61.80,61.30,61.30,5037,1113470,61.40,6973,169972,62.00,60.70,61.30,0.30,1478284,455310,90644015.20,65.20,56.70
如何输出成表格,分3行 19列显示啊。 主要是没每行数据如何拆分呢?


------解决方案--------------------
YX1206=YX1206,524.00,525.00,520.00,520.00,392,1050,523.00,543,2049,527.00,520.00,524.00,-4.00,1660,7664,870182.00,560.00,487.00

YX1209=YX1209,545.00,547.00,552.00,551.00,6893,256324,552.00,6603,117688,553.00,546.00,549.00,7.00,1308386,452116,718696576.00,583.00,506.00

SW1209=SW1209,61.00,61.80,61.30,61.30,5037,1113470,61.40,6973,169972,62.00,60.70,61.30,0.30,1478284,455310,90644015.20,65.20,56.70

这个意思,preg_replace找数字之后跟英文字母的地方,换上一个\n。