php 正则匹配 a标签 包含href的单双引号区别

function check_link($str)
{
$patten = "/<a.*?href\s*?=\s*?[\"\'](.*?)[\"\'].*?>(.*?)<\/a>/is";
preg_match_all($patten,$str,$match);
return $match;
}

posted @ 2023-08-21 18:04  宋先生日记  阅读(46)  评论(0编辑  收藏  举报