I'm trying to find a way to make a list of everything between <a>
and </a>
tags. So I have a list of links and I want to get the names of the links (not where the links go, but what they're called on the page). Would be really helpful to me.
Currently I have this:
$lines = preg_split("/
?
|
/", $content); // content is the given page
foreach ($lines as $val) {
if (preg_match("/(<A(.*)>)(</A>)/", $val, $alink)) {
$newurl = $alink[1];
// put in array of found links
$links[$index] = $newurl;
$index++;
$is_href = true;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…