他の人がコメントで言ったように、正規表現を使用する代わりにDOMDocumentを試してください。
ここに例があります(少しハックですが)それが役立つことを願っています:
function get_register_by_id($id){
$site = file_get_contents('http://www.internic.net/registrars/registrar-'.$id.'.html');
$dom = new DOMDocument();
@$dom->loadHTML($site);
$result = array();
foreach($dom->getElementsByTagName('td') as $td) {
if($td->getAttribute('width')=='420'){
$innerHTML= '';
$children = $td->childNodes;
foreach ($children as $child) {
$innerHTML .= trim($child->ownerDocument->saveXML($child));
}
$fixed = array_map('strip_tags', array_map('trim', explode("<br/>",trim($innerHTML))));
foreach($fixed as $val){
if(empty($val)){continue;}
$result[] = str_replace(array('! '),'',$val);
}
}
}
return $result;
}
print_r(get_register_by_id(965));
/*Array
(
[0] => Domain Central Australia Pty Ltd.
[1] => Level 27
[2] => 101 Collins Street
[3] => Melbourne Victoria 3000
[4] => Australia
[5] => +64 300 4192
[6] => robert.rolls@domaincentral.com.au
)*/
print_r(get_register_by_id(966));
/*
Array
(
[0] => Web Business, LLC
[1] => PO Box 1417
[2] => Golden CO 80402
[3] => United States
[4] => +1.303.524.3469
[5] => support@webbusiness.biz
)*/
print_r(get_register_by_id(967));
/*
Array
(
[0] => #1 Host Australia, Inc.
[1] => 1800 SW First Ave., Suite 440
[2] => Portland OR 97201
[3] => United States
[4] => 310-467-2549
[5] => registry-operations@moniker.com
)*/