PHP simple output CSV table file method details. Copy the code as follows: $ ret; $ arrsarray (array (1, test1), array (2, test2), array (3, test3), array (4, test4 ), array (5, test5), array (6, test6), array (7, test7 ));
The code is as follows:
$ Ret = '';
$ Arrs = array (1, 'test1 '),
Array (2, 'test2 '),
Array (3, 'test3 '),
Array (4, 'test4 '),
Array (5, 'test5 '),
Array (6, 'test6 '),
Array (7, 'test7 ')
);
Foreach ($ arrs as $ k => $ arr ){
$ Ret. = $ arr [0]. ",". $ arr [1]. "\ n ";
}
// $ Ret = @ mb_convert_encoding ($ ret, 'gbk', 'utf-8 ');
Header ("Content-Disposition: attachment; filename=xxxx.csv ");
Header ("Content-Type: APPLICATION/OCTET-STREAM ");
Echo $ ret;
The http://www.bkjia.com/PHPjc/327729.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/327729.htmlTechArticle code is as follows: $ ret = ''; $ arrs = array (1, 'test1'), array (2, 'test2'), array (3, 'test3'), array (4, 'test4'), array (5, 'test5'), array (6, 'test6'), array (7, 'test7 '));...