php 抓取某个标签的特定属性值的内容
function get_tag_data($str,$tag,$attrname,$value){ //返回值为数组 ,查找到的标签内的内容
$regex = "/<$tag.*?$attrname=\".*?$value.*?\".*?>(.*?)<\/$tag>/is";
preg_match_all($regex,$str,$matches,PREG_PATT...
原创
2018-04-08 18:45:15 ·
5512 阅读 ·
1 评论