0

I have used maatwebsite/excel 2.1 to read the excel file but i faced problem while reading multiple heading excel file(EX: as shown in first fig). I can't read all the data as it skipped all the rows except first of second heading(As shown in second fig highlighted).

First Image with excel data

Second Image with only fetched data highlighted

The data was fetched as:

[
    {"name":"First","0":"F","address":"Country","result":"A"}, 
    {"name":"foo","0":456,"address":"nep","result":324}, 
    {"name":"bar","0":456,"address":"aus","result":324}, 
    {"name":"baz","0":222,"address":"uk","result":21}
    ]

Skipping all the other row of data. So, i want ask for help in fetching all data and also in organised way if possible EX:

["name":{
            "first":"foo",
            "middle":" ",
            "last":"asd"
           },
  "address":{
             "country":"nep",
               ...
               ],
 ...
]

OR AS

[{
   "name.first":"foo",
   "name.middle":" ",
   "name.last":"asd",
   "address.country":"nep",
    ......}]

If this is not possible with available library than can anyone tell me how the excel individual cell data is read in PHP(core level).

3
  • Please go read How to Ask. Commented Jun 18, 2018 at 12:07
  • Recently I have did something you need: stackoverflow.com/questions/50790846/… Commented Jun 18, 2018 at 12:41
  • @dekts You have asked on question about exporting data to excel but i have problem in importing it . But thanks for your reply Commented Jun 18, 2018 at 16:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.