loadHTML($html); # Iterate over all the tags foreach($dom->getElementsByTagName('a') as $link) { # Show the echo $link->getAttribute('href'); echo "
"; } ?>