下面二款preg_match_all("/http:[/]{2}[a-z] [.]{1}[a-zd-] [.]{1}[a-zd]*[/]*[A-Za-zd]*[/]*[A-Za-zd]*[.]*html/",$url,$array);
var_dump($array);
?>
例子
$url = 'http://www.test.com/icons/favicon-54.ico, http://www.baidu.com/bb, http://www.jquerycn.cn, http://img.baidu.com/logo.ico';
$pattern = "|http://[^,] ?.ico,?|U";
preg_match_all($pattern, $url, $matches);
print_r($matches);
输出结果:
Array
(
[0] => Array
(
[0] => http://www.test.com/icons/favicon-54.ico
[1] => http://img.baidu.com/logo.ico
)
)