Ok, so I have a huge text file (around 2 gigabytes) and it has about 2 billion lines. All I've tried so far is
$myfile = fopen("C:\Users\server\Desktop\primes.txt", "r") or die("Unable to
open file!");
while(!feof($myfile)) {
echo fgets($myfile) . "<br>";
}
fclose($myfile);
but has a problem with not finishing all of the lines and hangs up somewhere in the first quarter - and it also takes a long time to load. Second thing I've tried was this
$path="C:/Users/server/Desktop/Server files/application.windows64/";
$file="primes.txt";
//read file contents
$content="
<code>
<pre>".file_get_contents("$path/$file")."</pre>
</code>";
//display
echo $content;
But it wasn't even loading lines.
Also, I can't directly open this file and it has to be on my Desktop. Please don't suggest me to copy or move it into another directory.
Could I get any suggestions to help me get along or at least an explanation why it's not working?
Sorry, my English isn't as good as it should be.