- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$pattern = '~<a\s*(.*)\>(.*)</a>~';
$subject = '<a href="#">hello</a> <abbr href="#">FYI</abbr> <a title="goodbye">later</a>';
preg_match_all($pattern, $subject, $matches);
print_r($matches[2]);