Hi,
You've forgot to put fread() :
<?
$file = fopen('closings.html', 'r');
if (!$file) echo 'Error opening file';
else echo 'got the file<br>';
$data = fread($file, filesize('closings.html'));
if
(eregi('<tr><td>Stratford</td><td>Closed</td></tr>',
$data))
echo 'Stratford closed';
else
echo 'Stratfor open';
?>
--- Tyler Longren <[EMAIL PROTECTED]> wrote: >
Hello everybody,
>
> Here's my code:
>
> <?
> $file = fopen("closings.html", "r");
>
> if (!$file) {
> print "Error getting file";
> }
> else {
> print "Closings.html has been gotten<Br>";
> if
>
(eregi("<tr><td>Stratford</td><td>Closed</td></tr>",$file))
> {
> print "Stratford Closed";
> }
> else {
> print "Stratford Open";
> }
> }
> ?>
>
> The file closings.html has tables with weather
> related closings. I want to
> search closings.html for this line:
> <tr><td>Stratford</td><td>Closed</td></tr>
>
> If that line is found, it prints "Stratford Closed",
> if it finds that line,
> it prints "Stratford Open". I'm not sure that the
> file is even open all the
> way. Thanks everyone!
>
> Regards,
> Tyler
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
=====
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Searching HTML file for tags
Mukul Sabharwal
Thu, 08 Feb 2001 18:07:31 -0800
- [PHP] Searching HTML file for <tr> tags Tyler Longren
- RE: [PHP] Searching HTML file for <tr> tags Mukul Sabharwal
- RE: [PHP] Searching HTML file for <tr> tags Tyler Longren
Reply via email to
Mukul Sabharwal Thu, 08 Feb 2001 18:07:31 -0800
- [PHP] Searching HTML file for <tr> tags Tyler Longren
- RE: [PHP] Searching HTML file for <tr> tags Mukul Sabharwal
- RE: [PHP] Searching HTML file for <tr> tags Tyler Longren

