Guest
#1
i want to echo all the linkname and their urls i got the code below for the url ,just dont know how to get the link name...?
$dom = new DOMDocument();
@$dom->loadHTML($content);
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$url = $href->getAttribute('href');
echo "
Link stored: $url";
//// i tried this//// $linkname=$href->getAttribute('name');
///echo"$linkname
";
}