- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$str = '<td valign="top" width="300"class="topborder"><ahref="/path/to/somewhere" class="bigger">random1</a><br/>
<td valign="top" width="300"class="topborder"><ahref="/path/to/somewhere2" class="bigger">random2</a><br/>';
$pattern = '/width=\"300\"class=\"topborder\"><ahref=\"(.*?)"/';
print "<pre>";
if (preg_match_all($pattern, $str, $match))
print_r($match);
else
print "nope";