- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$string = '<a href="http://www.google.com/" class=l2>Go to Google!</a>';
preg_match_all('/<a href="([^"]+)" class=l.+?>([^<]+)<\/a>/', $string, $results);
var_dump( $results);