I've been experimenting as a newbie with the various php file handling functions, specifically
// Set filename
$filename = 'http://www.domain.com/filename.htm';
// Set the handle
$handle = fopen ($filename, "r");
// Put it into a string
$data = fread ($handle, 120000);
//It makes no difference what size number is here, array1[7] still
//cuts off half way through, if I leave out array1[7] the previous
//array segment is the last one; If I make array1[7] the first
//segment, it still cuts off; if I leave it out and call array1[8] only,
//no output is generated at all
// Close the file
fclose ($handle);
// Explode it into an array
$array1 = explode("</tr>",$data);
The problem I experience is that the html generated from the above code works until half way through one of the generated array segments. In other words, only part of the file is created.
I am running out of ideas here. Possibilities, in descending order of likelihood, are:
The fread function is ending early;
The array construction process is incomplete;
The conversion of the array into html is wrong.
[/list=1]
I have run out of ways to test which problem is to blame, and I may not have thought of all the possible problems anyway.I'd very much appreciate some tips.
For information, the php file I am creating uses the PostNuke file blank.php as the skeleton, within which I wish to recreate the html file which I am trying to read from - created in Frontpage... aaargghhh!
The size of the source file is about 105000 while the segment read is about 8500, ending on a < tag at the beginning of an <i> tag.
TIA
Mac