Efficient file read
Posted: Mon Oct 28, 2002 3:04 pm
Hi,
I am trying to read in some HTML files to extract anchor links. My PHP execution time is set to 30 seconds by my host, so I need to make every fraction count.
I am trying to read in about 500 pages, and time-out at about 200. I have tried to find which part of my script is the slowest and start working there. I am using
which reads a file into an array. This takes about 0.2 seconds on my home PC through Apache. I guess processor / hard-drive speed will effect this, but the code needs to be portable so a general increase in efficiency is needed.
Is there a quicker way to read in an HTML file from a remote location?
Cheers.
I am trying to read in some HTML files to extract anchor links. My PHP execution time is set to 30 seconds by my host, so I need to make every fraction count.
I am trying to read in about 500 pages, and time-out at about 200. I have tried to find which part of my script is the slowest and start working there. I am using
Code: Select all
<?php
$file_array = file($file_name);
?>Is there a quicker way to read in an HTML file from a remote location?
Cheers.