正则替换掉网页中所有超链接
<?php
$content = file_get_contents('test.html');
$url = 'http://www.phprm.com'; //要换成的新网址
$preg = '/[s]href=("|')[S]*("|')/i';
$replace = ' href="' . $url . '"';
$content = preg_replace($preg, $replace, $content); //正则替换
create_log('newhtml', $content); //生成新文件
?>