Json output into exceljson content: [{ZtdID: 100000, ZtdNo: 001 & nbsp;, ZtdName: Shop 1 & nbsp;, Address: XX city ZZ district YY Road 01 Shop & nbsp;, Remark:, AreaID: 01, ZtdTel: 0000-8888888, how to output ZtdContact json into excel
The json content is as follows:
[{"ZtdID": "100000", "ZtdNo": "001", "ZtdName": "Shop 1", "Address ": "Shop No. 01, YY Road, ZZ district, XX city", "Remark": "", "AreaID": "01", "ZtdTel": "0000-8888888 ", "ZtdContact": "Zhangsan" },{ "ZtdID": "100001", "ZtdNo": "002", "ZtdName": "Shop 1", "Address ": "Shop No. 01, YY Road, ZZ district, XX city", "Remark": "", "AreaID": "01", "ZtdTel": "0000-8888888 ", "ZtdContact": "Li San"}]
Json parsing and excel output
Share:
------ Solution --------------------
First formatted into an array, and then can be generated with some generated excel class, such as http://code.google.com/p/php-excel/
------ Solution --------------------
Phpexcel or some other lightweight plug-ins to generate excel
------ Solution --------------------
Convert json back to data, json_decode
Generate an excel file and put the input in the array