Re: Grabbing
| From: | _lallous | Date: | Fri, 21 Sep 2001 12:54:58 +0000 |
| Subject: | Re: Grabbing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68134@lists.php.net to get a copy of this message | ||
I guess the ereg() will stop when i reads a new line character, therefore
try to use the preg_match() with /is modifiers.
preg_match("/$begin(.*?)$end", $search, $matches);
"Daniel alsén" <d@mindbash.com> wrote in message
news:PGEGIELINOCCEHLENIOJEENNCCAA.d@mindbash.com...
> Hi,
>
> iam trying to grab info from a webpage.
>
> This snippet is the part that does the actual searching...
>
> $site = "www.whatever.com/something.html";
> $open = fopen($site, "r");
> $search = fread($open, 20000);
> fclose($open);
> $search = ereg("$begin(.*)$end", $search, $content);
>
> What i find strange is that the search only works on the actual text in
the
> html-document. It doesn´t seem to be able to use htmltags as $begin or
$end.
>
> And another question: does the "search" of $end begins from $begin? Or
does
> it scan the whole document for both strings?
>
> Regards
> # Daniel Alsén | www.mindbash.com #
> # d@mindbash.com | +46 704 86 14 92 #
> # ICQ: 63006462 | #
>