read txt files with php

Asked

Viewed 160 times

0

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

1 answer

1


Try with the PHP file itself.

$f = file("arquivo.txt");
foreach($f as $item){
  echo $item .'<br>';
}
  • I imagine doing this,but I am worried about the performance, imagine that I will have about 40 companies to generate tickets and each company will have approximately 30 to 50 tickets.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.