获取a标签中的url连接

$str = '<a href="http://www.baidu.com"></a>';
preg_match('/href=[\'|\"](\S+)[\'|\"]/i',$str,$result);
echo $result[1];

posted @ 2018-04-11 23:22  刹那风华——  阅读(2062)  评论(0)    收藏  举报