Hi there
I've kind of arrived at a solution for this but my question is "why is there a problem in the first place". [I am running php under Xitami on my W2k PC.]
I read a html file into a string then test that string for the presence of an identifier string, then do other things. Works fine as long as the string contains data.
What has taken up hours of my time today is that if the original file is empty, so the string is empty, then when I run the page I get "php.exe has generated errors and will be closed by Windows" and that is that! (the problem being that 1 file out of 1,000 I was working on had this characteristic and took quite a while to work out that what was happening).
Here's the stripped down problem code:
<?php
$tfile = ('test123.html');
$html = file_get_contents($tfile);
$pos = strpos ($html, 'align');
print "$tfile $pos <br>";
?>
The problem occurs in the line $pos = strpos ($html, 'align'); whenever test123 contains no data, hence $html has length 0 - otherwise it works fine. Is this all very obvious and as should be expected or what?
ayj