Okay, I removed that line and I no longer get the invalid File-Handle
resource error, but I also don't get anything useful. Maybe my fscanf() line
needs some work? With this new code, if I print_r($headlines); I get 229 of
these: Array ( [0] => )

Code:
$filename =
fopen("http://www.kinyradio.com/juneaunews/latest_juneau_news.html";, "r");

while($headlines = fscanf($filename, "<p style=\"padding-left: 45\"><font
face=\"Verdana\" size=\"3\"><b>%[a-zA-Z0-9,. ]</b></font>")) {
                        print_r($headlines);
                        }
        fclose($filename);

What the fscanf() code -should- be doing, or at least what I intend for it
to do, is grab everything between <p style="padding-left: 45...><b> and
</b></font> - is my code structured for that?

-----Original Message-----
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 10:16 PM
To: 'Jason Soza'; David Robley; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Using fopen()/fread()/fscanf()


I'm thinking that you need to remove the:
   $contents = fread($filename, 1000000);
line. This is probably making the file pointer point to the end of the file.

-----Original Message-----
From: Jason Soza [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 4:17 PM
To: David Robley; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Using fopen()/fread()/fscanf()


I'm fairly certain that fopen() is working fine - I can echo "$contents";
and it works great, but it displays the entire page that I fetched. I just
want certain parts of the page and unfortunately, fscanf() doesn't seem to
think $contents or $filename are valid. Just more info on this, I tried
replacing fscanf($filename,...) with fscanf($contents,...) and got the same
result.

Thanks,
Jason Soza


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to