I hope you can help me with a problem that I do not know how to solve.
It turns out that I have a database of telephone numbers in a txt file, as this file weighs almost 2GB, I decided to split them into files with about 20,000 lines, generating 5000 txt files in this way.
I would need to include them using an include within a div in the following way
<php include "file1.txt"; ?>
the problem is that I would have to do this task 5000 times, generating another 4999 php files to include within a div.
It occurs to me then, to do something so that I take all the txt files of a certain directory, the pages and load them into the div when I click on the paginated link.
Try a code that I found as the following
<? php $ folder = "arg /";
$ files = scandir ($ folder);
if (isset ($ _ GET ['alpha'])) && strlen ($ _ GET ['alpha']) == 1) {
foreach ($ files as $ file) {
$ reg = '/ ^'. $ _GET ['alpha']. '. * \. php $ / i';
if (preg_match ($ reg, $ file)) {
echo '<a href="'.$folder.$file.'">'. $ file. ;
}
}
}
?>
But I do not work the absolute, could you give me a little hand please?