You can use an XPath expression to achieve this:
//tr[starts-with(@id, "link")]
Example:
$dom = new DOMDocument;
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$nodes = $xpath->query('///tr[starts-with(@id, "link")]');
foreach ($nodes as $node) {
// Do whatever
}