script doesn't finish displaying large txt file
Posted: Wed Oct 12, 2005 7:28 pm
I have a very large txt file that I use as a database on my local computer and use a php script to manipulate it.
I was running this through the apache server and loading a script in my
"http://localhost/dev/" directory, which basically reads all lines and prints only a certain field from each of the lines.
However when I run this it seems to read the file's contents fine but when it comes to printing all the specific fields, most of the time it does not finish printing past the half point. After reloading the page several times, I'd get varying results, sometimes printing more, sometimes less, but most of the time falling short of printing all the specific fields. What's going on here?
I was running this through the apache server and loading a script in my
"http://localhost/dev/" directory, which basically reads all lines and prints only a certain field from each of the lines.
However when I run this it seems to read the file's contents fine but when it comes to printing all the specific fields, most of the time it does not finish printing past the half point. After reloading the page several times, I'd get varying results, sometimes printing more, sometimes less, but most of the time falling short of printing all the specific fields. What's going on here?
Code: Select all
$contents=file('C:/bigtextfile.txt');
$line=array();
foreach ($contents as $v)
{
$line[]=explode("|",$v);
}
foreach ($line as $v)
{
print $v[0];
}