'; $dom = new DomDocument(); $dom->loadHTML($html); $tags = $dom->getElementsByTagName('a'); foreach ($tags as $a){ print '' . $a->nodeValue . '
'; if ($a->hasAttributes()){ foreach ($a->attributes as $attribute){ print '- ' . $attribute->name . ': ' . $attribute->value; print "
";} } print "
"; } print ''; ?>