|
Posted by Stephen Kay on 03/30/06 02:10
I'm wondering if there is any advantage one way or the other to these two
methods of reading an html file:
1. using fopen and friends:
$myFile = "http://www.example.com/page.html";
$fh = fopen($myFile, 'r');
$content1 = fread($fh, filesize($myFile));
fclose($fh);
2. using imploed, and file:
$content1 = implode('', file("http://www.example.com/page.html"));
They both seem to work equally well, but the number 1. seems to be more
robust with different file types...
Note: I can't use file_get_contents() because my ISP's PHP version is 4.1 or
so.
--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^
Navigation:
[Reply to this message]
|