Re: Re: Using fopen()/fread()/fscanf()
| From: | Jason Wong | Date: | Tue, 23 Jul 2002 09:19:58 +0000 |
| Subject: | Re: Re: Using fopen()/fread()/fscanf() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109058@lists.php.net to get a copy of this message | ||
On Tuesday 23 July 2002 15:38, Jason Soza wrote:
> Alright, I see that this is probably the way to go, but I'm dying here. I
> have this:
>
> $filename =
>
> fopen("http://www.kinyradio.com/juneaunews/latest_juneau_news.html",
> "r");
> $contents = fread($filename, 1000000);
> preg_match_all("|<font face=\"Verdana\"
> size=\"3\"><b>+[-a-zA-Z0-9,.
> ]+|i", $contents, $out);
> print_r($out);
Assuming that the <font> and <b> tags are closed and you want everything in
between then try this:
preg_match_all("|<font face=\"Verdana\"
size=\"3\"><b>(.*)</b></font>|i",
$contents, $out);
> The manual entries for preg_match and preg_match_all pretty much assume you
> have a working knowledge of reg expressions, which I don't, and a google
> search turned up a bunch of pages, none of which I could understand enough
> to be of help. So, any pointers would be appreciated. Thanks!
You want to read up on "Pattern Modifiers" and "Pattern Syntax", that's
where
all the regex black magic is explained.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
He's dead, Jim.
-- McCoy, "The Devil in the Dark", stardate 3196.1
*/