Creating a multidimensional object for XML export

后端 未结 2 1923
庸人自扰
庸人自扰 2021-01-29 10:44

I am importing a csv file which has a lot of invoice data. This data needs to be grouped together based on Vendor ID to display a heading for each Vendor with a sum of all invo

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-29 11:12

    I structured the CVS with object/arrays using php:

     while ($row = fgetcsv($handle, 1024, ",")) {
                   $cardCodes[] = array_combine($headers, $row);
            }
    
                foreach ($cardCodes as $key => $value) {
    
                    $payments[$value['ggg']]['aaa']['xxx'] = 'element['gggg']';
                }
                echo json_encode($payments);
    

    Then read this data with JS.

提交回复
热议问题