Re: preg_match_all
- From: "Rik Wasmus" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Sat, 31 May 2008 17:08:16 +0200
On Sat, 31 May 2008 16:49:30 +0200, Anthony Smith <mrsmithq@xxxxxxxxxxx> wrote:
I am trying to take a web page and get all of the links. It almost
works, but I am missing a few links.
Here is what I am using.
preg_match_all('/href=[\"\']?([^\"\'>]*)[\"\']?[^>]*>(.*?)<\/a>/i',
$s,$matches,PREG_SET_ORDER);
It will not pick up links like this:
<a class="highlight" href="browse.php?region=West
+Tennessee&zips=38115&mgrp=13&p=2">
<b>Next ></b>
</a>
How do I get it to pickup hrefs like the one above?
Add the /s modifier
--
Rik Wasmus
....spamrun finished
.
- References:
- preg_match_all
- From: Anthony Smith
- preg_match_all
- Prev by Date: preg_match_all
- Next by Date: Re: Creating a simple hitcounter for PHP web pages. (saves to files)
- Previous by thread: preg_match_all
- Index(es):