read txt files with php

0

I have the following situation: I have files in txt format, which are generated by another program and I will have to read line to line this file to generate payment tickets, in this file approximately I will have 40 columns with data. Well, for the purpose of processing these data, it would be better for me to read this txt file and go directly to make the generation of the tickets, or I'd better put that data in a database and then to make the generation of those tickets I would do a reading of those data ? I will have files that can have more than 50 lines from a single company. I'm worried about the performance to do all of this. Will generate the tickets in PDF format I will be using HTML2PDF to generate the pdfs. Could you have another way to read these txt files?

    
asked by anonymous 13.06.2018 / 15:04

1 answer

1

Try the same PHP file.

$f = file("arquivo.txt");
foreach($f as $item){
  echo $item .'<br>';
}
    
13.06.2018 / 15:55