美文网首页
php 去除 curl 或者 file_get_contents

php 去除 curl 或者 file_get_contents

作者: IT行者q | 来源:发表于2019-03-23 11:08 被阅读0次

1, 只直上函数吧

function strip_html_tags($tags,$str){
    $html=array();
    foreach ($tags as $tag) {
        $html[]='/<'.$tag.'.*?>[\s|\S]*?<\/'.$tag.'>/';
        $html[]='/<'.$tag.'.*?>/';
    }
    $data=preg_replace($html,'',$str);
    return $data;
}

相关文章

网友评论

      本文标题:php 去除 curl 或者 file_get_contents

      本文链接:https://www.haomeiwen.com/subject/pbgjvqtx.html