I'm trying to capute the link target only within a specific section of html. There can be a variable number of links, and variable amount of text before and after them. I then want to output the list.
Here's what I have, and it only seems to capture the first link.
preg_match_all('/<!-- BEGIN CONTENT SLOT: SEO Text -->.*<a href="(.*)">.*<!-- END CONTENT SLOT: SEO Text -->/siU', $input, $capture, PREG_SET_ORDER);
if (count($capture) > 0) {
$i = 1;
foreach ($capture as $url) {
echo $url[1] . '|';
$i++;
} //foreach
}
Thanks