-2

I have to read data from the text file in line by line to save to the database. How do I read the data?

below is sample data from the text file

    return-date                 order-id              sku
    2019-01-30T20:17:27+00:00   113-3085323-1960253 GCA-6000KITb
    2019-01-30T20:17:27+00:00   113-3085323-1960253 GCA-6000KITb
Juluri Vinay
  • 105
  • 3
  • 14
  • 2
    _How do I read the data..._ Where is your code that is trying to achieve that? What errors/issues are you facing there? – B001ᛦ May 16 '19 at 08:59
  • Hi there, please provide some code that you have already used to try solve this problem. Stack Overflow is not a tutorial or how-to site, however we can help you to debug your code. – George Hanson May 16 '19 at 09:00
  • https://stackoverflow.com/questions/13246597/how-to-read-a-large-file-line-by-line chat for how to read line by line – Elena Roman May 16 '19 at 09:04

1 Answers1

0

You could use str_getcsv with "\t" (tab character) as the $delimiter.

Bootdisk
  • 75
  • 6