目錄
Living Music校园歌唱大赛半决赛距离开赛还有???
回复内容:
首頁 後端開發 php教程 正则表达式 - 如何用 php 抓取微信文章正文?

正则表达式 - 如何用 php 抓取微信文章正文?

Jun 06, 2016 pm 08:32 PM
php 微信 正規表示式

我是一个新手,想使用php抓取微信页面的正文和标题,标题直接用正则表达式|<title>(.*?)|i</title>就抓取到了,但是正文我想的是|>(.*?)匹配标签间的内容,再去掉空格,但是还是会匹配到一堆标签,是怎么回事?或者说有其他更好的方法吗?求指教!

http://mp.weixin.qq.com/s?__biz=MzA5NTQ2NjUzMA==&mid=207136729&...

这是一般的微信文章内容链接

下面是这链接的页面代码

<code><br>             <script type="text/javascript">
    var sampling = Math.random() < 0.001;
    var page_begintime = (+new Date());
    (sampling) && ((new Image()).src = "http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=7839&flag2=7&flag3=8&15=1000&r=" + Math.random());

    var biz = "MzA5NTQ2NjUzMA==";
    var sn = "a82af7b7ba0bee9a7017b607dc7e5d4b" || "";
    var mid = "207136729" || "";
    var idx = "1" || "" ;

    //辟谣需求
    var is_rumor = ""*1;
    var norumor = ""*1;
    if (!!is_rumor&&!norumor){
      if (!document.referrer || document.referrer.indexOf("mp.weixin.qq.com/mp/rumor") == -1){
        location.href = "http://mp.weixin.qq.com/mp/rumor?action=info&__biz=" + biz + "&mid=" + mid + "&idx=" + idx + "&sn=" + sn + "#wechat_redirect";
      }
    }

    //原创需求,需要跳转到中间页
    /*
    var copyrightInfo = {
        display_source : ""*1,
        nocopyrightsource : ""*1
    };
    if (!!copyrightInfo.display_source&&!copyrightInfo.nocopyrightsource){
      if (!document.referrer || document.referrer.indexOf("mp.weixin.qq.com/mp/reprint") == -1){
        location.href = "http://mp.weixin.qq.com/mp/reprint?action=info&__biz=" + biz + "&mid=" + mid + "&idx=" + idx + "&sn=" + sn + "#wechat_redirect";
      }
    }*/
</script>        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="dns-prefetch" href="//res.wx.qq.com">
<link rel="dns-prefetch" href="//mmbiz.qpic.cn">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<link rel="shortcut icon" type="image/x-icon" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/favicon22c41b.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript">
    var uin = "";
    var key = "";
    var pass_ticket = "";

String.prototype.html= function(encode) {
    var replace =["&#39;", "'", """, '"', " ", " ", ">", ">", "<", "<", "&", "&", "&yen;", "¥"];
    //console.log(replace);
    if(encode){
        replace.reverse();
    }
    for (var i=0,str=this;i< replace.length;i+= 2){
         str=str.replace(new RegExp(replace[i],'g'),replace[i+1]);
    }

    return str;
};
pass_ticket = encodeURIComponent(pass_ticket.html(false).html(false).replace(/\s/g,"+"));
</script>        <title>Living Music校园歌唱大赛半决赛距离开赛还有???</title>        <link rel="stylesheet" type="text/css" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve251980.css"><style>         </style><!--[if lt IE 9]><link rel="stylesheet" type="text/css" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve_pc25624b.css"><![endif]--><script type="text/javascript">
    document.domain = "qq.com";
</script>    </head>    <body id="activity-detail" class="zh_CN mm_appmsg" ontouchstart="">            <script type="text/javascript">
        var write_sceen_time = (+new Date());
        (sampling) && ((new Image()).src = "http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=7839&flag2=7&flag3=8&16=1000&r=" + Math.random());
    </script>        <div id="js_cmt_mine" class="discuss_container editing access" style="display:none;">        <div class="discuss_container_inner">            <h2 id="Living-Music校园歌唱大赛半决赛距离开赛还有">Living Music校园歌唱大赛半决赛距离开赛还有???</h2>            <div class="frm_textarea_box_wrp">                <span class="frm_textarea_box">                    <textarea id="js_cmt_input" class="frm_textarea" placeholder="评论将由公众帐号筛选后显示,对所有人可见。"></textarea>                </span>            </div>            <div class="discuss_btn_wrp"><a id="js_cmt_submit" class="btn btn_primary btn_discuss btn_disabled" href="javascript:;">提交</a></div>            <div class="discuss_list_wrp" style="display:none">                <div class="rich_tips with_line title_tips discuss_title_line">                    <span class="tips">我的评论</span>                </div>                <ul class="discuss_list" id="js_cmt_mylist"></ul>            </div>            <div class="rich_tips tips_global loading_tips" id="js_mycmt_loading">                <img class="rich_icon icon_loading_white lazy"  src="/static/imghw/default1.png"  data-src="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/icon_loading_white22c04a.gif"  alt="">                <span class="tips">加载中</span>            </div>            <div class="wx_poptips" id="js_cmt_toast"   style="max-width:90%">                <img class="icon_toast lazy"  src="/static/imghw/default1.png"  data-src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGoAAABqCAYAAABUIcSXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8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t9qabiqPgup1yKyQwvC2tSefZ73SSpNkUJ4PlLorlHZ+446nc8f3fIyywlJhwrTuwVSjBa1ccvSxN0hjjoK5xVrYZMd9V6XbFfgBukixTwGLg8sDam3dZR/wZ6L/dJlin1en8LS+bgpFbz3Ygvzu1J1HKxYNqxGpCmaCEo12rrBorD6LRp8UbpcdR5VWhTW35KlKd6QFqjuM2XzwlpnMxTvSkuUwuG/Xlg6NtPjbT6WFimF/VG6LEvXgn8QGDjMbBukVECFwhpoS+CQatfX2Q1q6H7wENHdrfCr0lKleEB9JyxNneus+VJpsVL9TwI6W65LovWIGl3KtVJaLv7LBwYTFEERFEVQFEERFEVQFEERFEVQFEERFEVQFEERFEVQFEERFFWq/hFgADUMN4RzT6/OAAAAAElFTkSuQmCC"  alt="">                <p class="toast_content">已评论</p>            </div>        </div>    </div>    <div id="js_article" class="rich_media">                <div id="js_top_ad_area" class="top_banner">         </div>                        <div class="rich_media_inner">            <div id="page-content">                <div id="img-content" class="rich_media_area_primary">                    <h2 id="Living-Music校园歌唱大赛半决赛距离开赛还有">                        Living Music校园歌唱大赛半决赛距离开赛还有???                     </h2>                    <div class="rich_media_meta_list">                                                <em id="post-date" class="rich_media_meta rich_media_meta_text">2015-04-27</em>                                                <a class="rich_media_meta rich_media_meta_link rich_media_meta_nickname" href="javascript:void(0);" id="post-user">gzgsytw</a>                        <span class="rich_media_meta rich_media_meta_text rich_media_meta_nickname">gzgsytw</span>                        <div id="js_profile_qrcode" class="profile_container"   style="max-width:90%">                            <div class="profile_inner">                                <strong class="profile_nickname">gzgsytw</strong>                                <img class="profile_avatar lazy"  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxVbrSdHIQokUcfwqLgHDeHAOIct2NKByo5P7WOGqux1uqDFAfUH922afy36pc8Ge8t8nyNCxKK6Ng/0"  id="js_profile_qrcode_img" alt="">                                <p>                                <label>微信号</label>                                <span>gzgsytw0</span>                                </p>                                <p>                                <label>功能介绍</label>                                <span>校园内有关团委的一切动态一切资讯都可在这里接收查找。</span>                                </p>                                                            </div>                            <span id="js_profile_arrow_wrp">                                <i></i>                                <i></i>                            </span>                        </div>                    </div>                                                                                                                                                                <div id="js_content"><fieldset   style="max-width:90%"><span style="display: inline-block; padding: 0.3em 0.5em; border-radius: 0.5em; color: rgb(255, 255, 255); text-align: inherit; font-size: 1em; box-shadow: rgb(165, 165, 165) 0.2em 0.2em 0.1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: rgb(71, 193, 168);"><p style="box-sizing: border-box;"><span style="font-size: 24px;">Living Music校园歌唱大赛半决赛距离开赛还有???</span></p></span></fieldset><p style="white-space: normal;"><br  /></p><fieldset style="white-space: normal; border: 0px; margin: 0px; clear: both; box-sizing: border-box; padding: 0px;"><section style="padding: 8px; margin: 0px; border-left-width: 6px; border-left-style: solid; border-color: rgb(71, 193, 168); font-size: 1em; line-height: 1.4; text-align: inherit; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: rgb(51, 51, 51); box-sizing: border-box;"><section style="box-sizing: border-box;"><p><span style="font-size: 18px; font-family: 宋体;">精彩绝伦的复赛没有来观看?没关系!30进15的淘汰赛已经结束,15进5的半决赛就在<span style="font-size: 36px; font-family: 宋体; color: rgb(49, 133, 155);"><strong>今晚!</strong></span></span></p></section></section></fieldset><p style="white-space: normal;"><img  class="profile_avatar lazy"  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxVbrSdHIQokUcfwqLgHDeHAOIct2NKByo5P7WOGqux1uqDFAfUH922afy36pc8Ge8t8nyNCxKK6Ng/0"  data-s="300,640" data-type="jpeg" data- data-ratio="0.726790450928382" data-w="377"  / alt="正则表达式 - 如何用 php 抓取微信文章正文?" ><br  /></p><p   style="max-width:90%"><br  /></p><fieldset class="tn-Powered-by-XIUMI" style="white-space: normal; border: 0px; margin: 0px; clear: both; box-sizing: border-box; padding: 0px;"><section class="tn-Powered-by-XIUMI" style="padding: 8px; margin: 0px; border-left-width: 6px; border-left-style: solid; border-color: rgb(71, 193, 168); font-size: 1em; line-height: 1.4; text-align: inherit; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: rgb(51, 51, 51); box-sizing: border-box;"><section class="tn-Powered-by-XIUMI" style="box-sizing: border-box;"><p><span style="font-size: 36px;"><strong><span style="font-family: 宋体; color: rgb(49, 133, 155);">今晚六点半</span></strong></span><span style="font-size: 18px;"><strong><span style="font-family: 宋体; color: rgb(49, 133, 155);"></span></strong><span style="font-family: 宋体;">Living Music大赛花都校区的十五强选手将在<span style="font-size: 36px; font-family: 宋体; color: rgb(49, 133, 155);"><strong>实验楼105</strong></span>举行的半决赛当中角逐出进入最终决赛的五名选手,届时将和三水校区进入决赛的五名选手共同组成广工商十强歌手来竞争广工商<span style="font-size: 36px; font-family: 宋体; color: rgb(255, 0, 0);"><strong>最强音的宝座!!</strong></span></span></span></p></section></section></fieldset><p style="white-space: normal;"><img  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxVicCIE0fvVEsL865N96Ds2cuLr8deLzfyGmmNLd5dKgP4m0FQ57uNewg4tMn2wiadSxhEMqptr1dxQ/0"  class="lazy"  data-s="300,640" data-type="jpeg" data- data-ratio="0.5964912280701754" data-w="456"  / alt="正则表达式 - 如何用 php 抓取微信文章正文?" ><br  /></p><fieldset class="tn-Powered-by-XIUMI"   style="max-width:90%"><section class="tn-Powered-by-XIUMI" style="padding: 8px; margin: 0px; border-left-width: 6px; border-left-style: solid; border-color: rgb(71, 193, 168); font-size: 1em; line-height: 1.4; text-align: inherit; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: rgb(51, 51, 51); box-sizing: border-box;"><section class="tn-Powered-by-XIUMI" style="box-sizing: border-box;"><span style="font-size: 18px;">广工商最强音的诞生需要你的见证,come on 小伙伴,即使不是最专业的点评家,你也可以是<span style="font-size: 36px; color: rgb(49, 133, 155);"><strong>最专业的聆听者</strong></span><span style="font-size: 36px; color: rgb(49, 133, 155);">!</span></span></section></section></fieldset><p style="white-space: normal;"><img  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxV1eIfFV9Do2a4aUp0koiadsKydXaDL3d696kOuEpXq5XSbrHk86fnicm6tG8ZPlQI6BsukIMlQmjGg/0"  class="lazy"  data-s="300,640" data-type="jpeg" data- data-ratio="1.0588235294117647" data-w="289"  / alt="正则表达式 - 如何用 php 抓取微信文章正文?" ><br  /></p><fieldset class="tn-Powered-by-XIUMI"   style="max-width:90%"><section class="tn-Powered-by-XIUMI" style="padding: 20px; color: rgb(255, 255, 255); text-align: center; font-weight: bold; line-height: 1.4; box-shadow: rgb(221, 221, 221) 0px 3px 3px; font-size: 1.4em; font-family: inherit; text-decoration: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: rgb(71, 193, 168);"><section class="tn-Powered-by-XIUMI" style="box-sizing: border-box;"><strong><span style="font-family: 宋体; font-size: 24px; line-height: 25.2000007629395px;"><span style="line-height: 28px;">Living Music大赛花都校区</span>15进5的半决赛</span></strong></section></section><p style="margin-top: 24px; text-align: inherit; font-size: 1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; line-height: 2em; background-color: transparent;"><img  class="tn-Powered-by-XIUMI lazy"  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/MVPvEL7Qg0GPLZlicQq2RYNicbDmd1xQT0Gicv1A0tlNRtyWzrwk4Odopjzzpwqo4YJkUl3x7nMbGeLATIszGPJ2Q/640"  data- data-ratio="1" data-w="30"   style="max-width:90%"  / alt="正则表达式 - 如何用 php 抓取微信文章正文?" > <span style="line-height: 25.6000003814697px; color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; text-decoration: inherit;">4月27日18:30(即今晚)</span></p><p style="margin-top: 16px; text-align: inherit; font-size: 1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: transparent;"><img  class="tn-Powered-by-XIUMI lazy"  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/MVPvEL7Qg0GPLZlicQq2RYNicbDmd1xQT0xTVEAtw1fibKcv7QmGPZ2SPibJyDvCcAI1jgWFZxhxb1XSBViae9ibboJg/640"  data- data-ratio="1" data-w="30"   style="max-width:90%"  / alt="正则表达式 - 如何用 php 抓取微信文章正文?" > <span style="line-height: 25.6000003814697px; color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; text-decoration: inherit;">实验楼105</span></p><p style="margin-top: 16px; text-align: inherit; font-size: 1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: transparent;"><span style="line-height: 25.6000003814697px; color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; text-decoration: inherit;"><br  /></span></p></fieldset><p><br  /></p></div>                    <script type="text/javascript">
                        var first_sceen__time = (+new Date());
                    </script>                    <link rel="stylesheet" type="text/css" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve_combo25624b.css">                                                                                                    <div class="rich_media_tool" id="js_toobar">                                                <div id="js_read_area" class="media_tool_meta tips_global meta_primary" style="display:none;">阅读 <span id="readNum"></span></div>                        <span style="display:none;" class="media_tool_meta meta_primary tips_global meta_praise" id="like">                            <i class="icon_praise_gray"></i><span class="praise_num" id="likeNum"></span>                        </span>                        <a id="js_report_article" style="display:none;" class="media_tool_meta tips_global meta_extra" href="javascript:void(0);">举报</a>                    </div>                </div>                <div class="rich_media_area_extra">                                        <div class="mpda_bottom_container" id="js_bottom_ad_area"></div>                                        <div id="js_iframetest" style="display:none;"></div>                                                        </div>                           </div>            <div id="js_pc_qr_code" class="qr_code_pc_outer" style="display:none;">                <div class="qr_code_pc_inner">                    <div class="qr_code_pc">                        <img  class="qr_code_pc_img lazy"  src="/static/imghw/default1.png"  data-src="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/moon230eaa.js"  id="js_pc_qr_code_img" alt="正则表达式 - 如何用 php 抓取微信文章正文?" >                        <p>微信扫一扫<br>关注该公众号</p>                    </div>                </div>            </div>        </div>    </div>                <script>window.moon_map = {"a/gotoappdetail.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/gotoappdetail2562f8.js","a/ios.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/ios24a769.js","a/android.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/android22772d.js","a/profile.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/profile24a2ff.js","biz_common/utils/report.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/report224ef3.js","biz_common/utils/cookie.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/cookie224ef3.js","appmsg/reward_entry.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/reward_entry256315.js","appmsg/comment.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/comment255696.js","appmsg/like.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/like2340dc.js","appmsg/a.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/a25624b.js","biz_common/tmpl.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/tmpl224ef3.js","biz_common/ui/imgonepx.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/ui/imgonepx224ef3.js","biz_common/dom/attr.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/dom/attr22f190.js","biz_wap/utils/ajax.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/utils/ajax22589f.js","biz_common/utils/string/html.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/string/html224ef3.js","appmsg/report.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/report23c757.js","biz_common/dom/class.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/dom/class236751.js","appmsg/report_and_source.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/report_and_source23a582.js","appmsg/page_pos.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/page_pos253aa9.js","appmsg/cdn_speed_report.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/cdn_speed_report224ef3.js","appmsg/iframe.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/iframe24f185.js","appmsg/review_image.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/review_image2480be.js","appmsg/outer_link.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/outer_link224ef3.js","biz_wap/jsapi/core.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/jsapi/core22589f.js","biz_common/dom/event.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/dom/event24f08a.js","appmsg/async.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/async25624b.js","biz_wap/ui/lazyload_img.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/ui/lazyload_img23354e.js","biz_common/log/jserr.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/log/jserr22589f.js","appmsg/share.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/share251ea5.js","biz_wap/utils/mmversion.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/utils/mmversion224ef3.js","appmsg/cdn_img_lib.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/cdn_img_lib23c757.js","biz_common/utils/url/parse.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/url/parse238f07.js","appmsg/index.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/index2567e4.js"};</script><script type="text/javascript"></script>    <script id="t_cmt" type="text/html">
        <li class="discuss_item" id="cid<# if (is_from_me == 1) { #><#=my_id#><# } else { #><#=content_id#><# } #>">
            <# if(is_elected == 1){ #>


<div class="discuss_opr">
                <span class="media_tool_meta tips_global meta_praise js_comment_praise <# if(like_status == 1){ #>praised<# } #>" data-status="<#=like_status#>" data-content-id='<#=content_id#>'>
                    <i class="icon_praise_gray"></i>
                    <span class="praise_num"><# if(like_num_format !== 0){ #><#=like_num_format#> <# } #></span>
                </span>
            </div>


            <# } #>
            <div class="user_info">
                <strong class="nickname"><#=nick_name#><# if(is_from_friend == 1){ #>(朋友)<# } #></strong>
                <img  class="avatar lazy"  src="/static/imghw/default1.png"  data-src="<#=logo_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >" >
            </div>
            <div class="discuss_message">
                <span class="discuss_status"><#=status#></span>
                <#=content#>
            </div>
            <p class="discuss_extra_info">
                <#=time#>               
                <# if (is_from_me == 1) { #>
                <a class="discuss_del js_del" href="javascript:;" data-my-id="<#=my_id#>" data-content-id="<#=content_id#>">删除</a>
                <# } #>
            </p>
            <# if(reply && reply.reply_list && reply.reply_list.length > 0){ #>
                <div class="reply_result">
                    <div class="nickname">作者回复</div>
                    <div class="discuss_message"><#=reply.reply_list[0].content#></div>
                    <p class="discuss_extra_info"><#=reply.reply_list[0].time#></p>
                </div>
            <# } #>

        </li>
    </script>  <script id="t_ad" type="text/html">
    <div class="rich_media_extra" id="gdt_area">
        <# if(pos_type==0){ #>
        <div class="rich_tips with_line title_tips">
            <span class="tips">推广</span>
        </div>
        <# } #>
        <div class="js_ad_link extra_link" data-type="<#=type#>" data-ticket="<#=ticket#>" data-url="<#=url#>" data-rl="<#=rl#>"  data-aid="<#=aid#>" data-pt="<#=pt#>" data-tid="<#=traceid#>" data-gid="<#=group_id#>" data-apurl="<#=apurl#>">
            <# if(pt==1){ #>
            <#=hint_txt#>
            <img  class="icon_arrow_gray lazy"  src="/static/imghw/default1.png"  data-src="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/icon_arrow_gray1ef6d4.png"  alt="正则表达式 - 如何用 php 抓取微信文章正文?" >
            <img  class="icon_loading_white icon_after lazy"  src="/static/imghw/default1.png"  data-src="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/icon_loading_white22c04a.gif"    style="max-width:90%" id="loading_<#=traceid# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >">
            <# }else if(pt==2){ #>

            <# if (logo.indexOf("http://mmsns.qpic.cn/") == 0){ #>
            <div class="brand_logo"><img  src="/static/imghw/default1.png"  data-src="<#=logo# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >"  class="lazy" alt="logo图片"></div>
            <# } #>
            <img  class="appmsg_banner lazy"  src="/static/imghw/default1.png"  data-src="<#=image_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >" >
            <# if(watermark_type!=0){ #><i class="promotion_tag"><# if(watermark_type==1){ #>商品推广<# }else if (watermark_type==2){ #>活动推广<# } #></i><# } #>
            <# }else if(pt==7){ #>

            <div class="preview_group preview_card">
                <div class="preview_group_inner card_inner">
                    <div class="preview_group_info">
                        <strong class="preview_group_title2"><#=hint_txt#></strong>
                        <div class="preview_group_desc"><#=ad_desc#></div>
                        <img  src="/static/imghw/default1.png"  data-src="<#=image_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >"  class="lazy" alt="" class="preview_card_avatar">
                    </div>
                </div>
            </div>
            <# }else if(pt==100){ #>
            <div class="preview_group">
                <div class="preview_group_inner">
                    <div class="preview_group_info append_btn">
                        <strong class="preview_group_title"><#=biz_info.nick_name#></strong>
                        <div class="preview_group_desc"><#=hint_txt#></div>
                        <# if(!!biz_info.head_img){ #>
                        <img  src="/static/imghw/default1.png"  data-src="<#=biz_info.head_img# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >"  class="lazy" alt="" class="preview_group_avatar br_radius">
                        <# }else{ #>
                        <img class="preview_group_avatar br_radius lazy"  src="/static/imghw/default1.png"  data-src="http://mmbiz.qpic.cn/mmbiz/a5icZrUmbV8p5jb6RZ8aYfjfS2AVle8URwBt8QIu6XbGewB9wiaWYWkPwq4R7pfdsFibuLkic16UcxDSNYtB8HnC1Q/0"  alt="<#=biz_info.nick_name#>">
                        <# } #>                                 
                    </div>
                    <div class="preview_group_opr">
                        <a id="js_view_profile_<#=pos_type#>" <# if(biz_info.is_subscribed == 0){ #>style="display:none"<# } #> class="btn btn_inline btn_primary btn_line js_ad_btn" href="javascript:void(0);">查看</a>
                        <a id="js_add_contact_<#=pos_type#>" data-url="<#=url#>" data-type="<#=type#>" data-tid="<#=traceid#>" data-rl="<#=rl#>" <# if(biz_info.is_subscribed ==1){ #>style="display:none"<# } #> class="btn btn_inline btn_line  btn_primary js_ad_btn" href="javascript:void(0);">关注</a>
                    </div>
                </div>
            </div>
            <# }else if(pt==102){ #>
            <div class="preview_group">
                <div class="preview_group_inner">
                    <div class="preview_group_info append_btn">
                        <strong class="preview_group_title"><#=app_info.app_name#></strong>
                        <div class="preview_group_desc"><#=hint_txt#></div>
                        <img  src="/static/imghw/default1.png"  data-src="<#=app_info.icon_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >"  class="lazy" alt="" class="preview_group_avatar br_radius">
                    </div>
                    <div class="preview_group_opr">
                        <a id="js_app_action_<#=pos_type#>" class="btn btn_inline btn_primary js_ad_btn btn_download" href="javascript:void(0);">下载</a>
                    </div>
                </div>
            </div>
            <# }else if(pt==101){ #>
            <div class="preview_group preview_card">
                <div class="preview_group_inner card_inner">                            
                    <div class="preview_group_info append_btn">
                        <strong class="preview_group_title"><#=app_info.app_name#></strong>
                        <div class="preview_group_desc"><#=hint_txt#></div>
                        <img  src="/static/imghw/default1.png"  data-src="<#=app_info.icon_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >"  class="lazy" alt="" class="preview_card_avatar">                               
                    </div>
                    <div class="preview_group_opr">
                        <a href="javascript:void(0);" id="js_app_action_<#=pos_type#>" class="btn btn_inline btn_primary js_ad_btn">下载</a>
                    </div>
                </div>                        
            </div>
            <# }else if(pt==103||pt==104){ #>
            <div class="preview_group obvious_app">
                <div class="preview_group_inner">
                    <div class="pic_app">
                        <img  src="/static/imghw/default1.png"  data-src="<#=image_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >"  class="lazy" alt="">
                    </div>
                    <div class="info_app">
                        <p class="name_app"><#=app_info.app_name#></p>
                        <# if(pt==103){ #>
                        <p class="profile_app" style="display:none;"><span class="fun_exp"><#=app_info._category#></span><em>|</em><span class="compacity"><#=app_info._app_size#></span></p>
                        <# } else if(pt==104){ #>
                        <p class="profile_app" style="display:none;"><span class="fun_exp"><#=app_info._app_size#></span><em>|</em><span class="compacity"><#=app_info._down_count#></span></p>
                        <# } #>

                        <p class="grade_app" id="js_app_rating_<#=pos_type#>">

                            <span class="js_stars stars" style="display:none;"></span>

                            <span class="js_scores scores">暂无评分</span>
                        </p>
                        <div class="dm_app">
                            <a href="javascript:void(0);" id="js_appdetail_action_<#=pos_type#>" class="ad_btn btn_download js_ad_btn">下载</a>
                            <p class="extra_info">来自<# if(pt==103){ #>App Store<# }else{ #>腾讯应用宝<# } #></p>
                        </div>
                    </div>
                </div>            
            </div>
            <# } #>
        </div>
    </div>
  </script>  

<script type="text/javascript">
      var not_in_mm_css = "http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/not_in_mm24ed02.css";
      var tid = "";
      var aid = "";
      var appuin = "MzA5NTQ2NjUzMA==";

      var source = "5";
      var scene = 75;
      
      var itemidx = "";
      var nickname = "gzgsytw";
      var ct = "1430117426";
      var user_name = "gh_33771b05aabb";
      var user_name_new = "";
      var fakeid   = "";
      var version   = "";
      var is_limit_user   = "0";
      var msg_title = "Living Music校园歌唱大赛半决赛距离开赛还有???";
      var msg_desc = "Living Music校园歌唱大赛半决赛距离开赛还有???精彩绝伦的复赛没有来观看?没关系!30进15的淘";
      var msg_cdn_url = "http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxUfLK8xco6YMfZA4gghicMQOabZNs7h3QsZqiaXAwKzic0ca3SESBko2AeeeOwFpkyGs41cTrhL6ewhA/0?wx_fmt=jpeg";
      var msg_link = "http://mp.weixin.qq.com/s?__biz=MzA5NTQ2NjUzMA==&mid=207136729&idx=1&sn=a82af7b7ba0bee9a7017b607dc7e5d4b#rd";
      var user_uin = "0"*1;
      var msg_source_url = '';
      var img_format = 'jpeg';
      var networkType;
      var appmsgid = '' || '207136729';
      var comment_id = "0" * 1;
      var svr_time = "1430658137" * 1;
      var comment_enabled = "" * 1;
      var is_need_reward = "0" * 1;
      var is_https_res = ("" * 1) && (location.protocol == "https:");

      var devicetype = "";

      seajs.use("appmsg/index.js");
  </script>

    </body></html>
</code>
登入後複製

回复内容:

我是一个新手,想使用php抓取微信页面的正文和标题,标题直接用正则表达式|<title>(.*?)<\/title>|i就抓取到了,但是正文我想的是|>(.*?)<\/|i匹配标签间的内容,再去掉空格,但是还是会匹配到一堆标签,是怎么回事?或者说有其他更好的方法吗?求指教!

http://mp.weixin.qq.com/s?__biz=MzA5NTQ2NjUzMA==&mid=207136729&...

这是一般的微信文章内容链接

下面是这链接的页面代码

<code><br><!DOCTYPE html><html>    <head>         <script type="text/javascript">
    var sampling = Math.random() < 0.001;
    var page_begintime = (+new Date());
    (sampling) && ((new Image()).src = "http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=7839&flag2=7&flag3=8&15=1000&r=" + Math.random());

    var biz = "MzA5NTQ2NjUzMA==";
    var sn = "a82af7b7ba0bee9a7017b607dc7e5d4b" || "";
    var mid = "207136729" || "";
    var idx = "1" || "" ;

    //辟谣需求
    var is_rumor = ""*1;
    var norumor = ""*1;
    if (!!is_rumor&&!norumor){
      if (!document.referrer || document.referrer.indexOf("mp.weixin.qq.com/mp/rumor") == -1){
        location.href = "http://mp.weixin.qq.com/mp/rumor?action=info&__biz=" + biz + "&mid=" + mid + "&idx=" + idx + "&sn=" + sn + "#wechat_redirect";
      }
    }

    //原创需求,需要跳转到中间页
    /*
    var copyrightInfo = {
        display_source : ""*1,
        nocopyrightsource : ""*1
    };
    if (!!copyrightInfo.display_source&&!copyrightInfo.nocopyrightsource){
      if (!document.referrer || document.referrer.indexOf("mp.weixin.qq.com/mp/reprint") == -1){
        location.href = "http://mp.weixin.qq.com/mp/reprint?action=info&__biz=" + biz + "&mid=" + mid + "&idx=" + idx + "&sn=" + sn + "#wechat_redirect";
      }
    }*/
</script>        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="dns-prefetch" href="//res.wx.qq.com"><link rel="dns-prefetch" href="//mmbiz.qpic.cn"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /><link rel="shortcut icon" type="image/x-icon" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/favicon22c41b.ico"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"><script type="text/javascript">
    var uin = "";
    var key = "";
    var pass_ticket = "";

String.prototype.html= function(encode) {
    var replace =["&#39;", "'", """, '"', " ", " ", ">", ">", "<", "<", "&", "&", "&yen;", "¥"];
    //console.log(replace);
    if(encode){
        replace.reverse();
    }
    for (var i=0,str=this;i< replace.length;i+= 2){
         str=str.replace(new RegExp(replace[i],'g'),replace[i+1]);
    }

    return str;
};
pass_ticket = encodeURIComponent(pass_ticket.html(false).html(false).replace(/\s/g,"+"));
</script>        <title>Living Music校园歌唱大赛半决赛距离开赛还有???</title>        <link rel="stylesheet" type="text/css" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve251980.css">
<style>         </style>
<!--[if lt IE 9]><link rel="stylesheet" type="text/css" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve_pc25624b.css"><![endif]--><script type="text/javascript">
    document.domain = "qq.com";
</script>                    <script type="text/javascript">
        var write_sceen_time = (+new Date());
        (sampling) && ((new Image()).src = "http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=7839&flag2=7&flag3=8&16=1000&r=" + Math.random());
    </script>        <div id="js_cmt_mine" class="discuss_container editing access" style="display:none;">        <div class="discuss_container_inner">            <h2 id="Living-Music校园歌唱大赛半决赛距离开赛还有">Living Music校园歌唱大赛半决赛距离开赛还有???</h2>            <div class="frm_textarea_box_wrp">                <span class="frm_textarea_box">                    <textarea id="js_cmt_input" class="frm_textarea" placeholder="评论将由公众帐号筛选后显示,对所有人可见。"></textarea>                </span>            </div>            <div class="discuss_btn_wrp"><a id="js_cmt_submit" class="btn btn_primary btn_discuss btn_disabled" href="javascript:;">提交</a></div>            <div class="discuss_list_wrp" style="display:none">                <div class="rich_tips with_line title_tips discuss_title_line">                    <span class="tips">我的评论</span>                </div>                <ul class="discuss_list" id="js_cmt_mylist"></ul>            </div>            <div class="rich_tips tips_global loading_tips" id="js_mycmt_loading">                <img class="rich_icon icon_loading_white lazy" src="/static/imghw/default1.png" data-src="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/icon_loading_white22c04a.gif" alt="">                <span class="tips">加载中</span>            </div>            <div class="wx_poptips" id="js_cmt_toast"   style="max-width:90%">                <img class="icon_toast lazy" src="/static/imghw/default1.png" data-src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGoAAABqCAYAAABUIcSXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5U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flgAsDXgehfdx1KkkTRE76tN+Xue2jnTU0Ru1oIbvpt30bBtKhOp5yaaRkts0lic8V1i6dPcIRx2d/l8Y8XtNNEg7OOo8bl1kmmOKnDsO88CaYzejau0hWZqiL7C83oCH4SeTHvwV2BqqsHRVztSEYOmWF80NeXZT6Hd4KflResE9vCnBOlCyGfDNAstHTVPUDWoQ1t3iW+9WNizvlhfd4aerXd+ThqiMfNR6+9LvOOro5OY5JX2H4+F7HZD+kGzlamMgldWiirQsjcwWFbjmqZJteekJLK9pisvgL6RhKvuciZiwzrWWGapfrPy30kBVcSBIrw0aD3PU0XB6cehntq7rTMf7/2iQlktDVdXJLXlg6VjmiYBn6rWSTRCH6hvJ0hQrpcGq8oidsmHpTP8t8DGO9/vcWt9qabiqPgup1yKyQwvC2tSefZ73SSpNkUJ4PlLorlHZ+446nc8f3fIyywlJhwrTuwVSjBa1ccvSxN0hjjoK5xVrYZMd9V6XbFfgBukixTwGLg8sDam3dZR/wZ6L/dJlin1en8LS+bgpFbz3Ygvzu1J1HKxYNqxGpCmaCEo12rrBorD6LRp8UbpcdR5VWhTW35KlKd6QFqjuM2XzwlpnMxTvSkuUwuG/Xlg6NtPjbT6WFimF/VG6LEvXgn8QGDjMbBukVECFwhpoS+CQatfX2Q1q6H7wENHdrfCr0lKleEB9JyxNneus+VJpsVL9TwI6W65LovWIGl3KtVJaLv7LBwYTFEERFEVQFEERFEVQFEERFEVQFEERFEVQFEERFEVQFEERFFWq/hFgADUMN4RzT6/OAAAAAElFTkSuQmCC" alt="">                <p class="toast_content">已评论</p>            </div>        </div>    </div>    <div id="js_article" class="rich_media">                <div id="js_top_ad_area" class="top_banner">         </div>                        <div class="rich_media_inner">            <div id="page-content">                <div id="img-content" class="rich_media_area_primary">                    <h2 id="Living-Music校园歌唱大赛半决赛距离开赛还有">                        Living Music校园歌唱大赛半决赛距离开赛还有???                     </h2>                    <div class="rich_media_meta_list">                                                <em id="post-date" class="rich_media_meta rich_media_meta_text">2015-04-27</em>                                                <a class="rich_media_meta rich_media_meta_link rich_media_meta_nickname" href="javascript:void(0);" id="post-user">gzgsytw</a>                        <span class="rich_media_meta rich_media_meta_text rich_media_meta_nickname">gzgsytw</span>                        <div id="js_profile_qrcode" class="profile_container"   style="max-width:90%">                            <div class="profile_inner">                                <strong class="profile_nickname">gzgsytw</strong>                                <img class="profile_avatar lazy" src="/static/imghw/default1.png" data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxVbrSdHIQokUcfwqLgHDeHAOIct2NKByo5P7WOGqux1uqDFAfUH922afy36pc8Ge8t8nyNCxKK6Ng/0" id="js_profile_qrcode_img" alt="">                                <p>                                <label>微信号</label>                                <span>gzgsytw0</span>                                </p>                                <p>                                <label>功能介绍</label>                                <span>校园内有关团委的一切动态一切资讯都可在这里接收查找。</span>                                </p>                                                            </div>                            <span id="js_profile_arrow_wrp">                                <i></i>                                <i></i>                            </span>                        </div>                    </div>                                                                                                                                                                <div id="js_content">
<fieldset style="white-space: normal; border: 0px; text-align: center; margin: 0.8em 0px 0.5em; box-sizing: border-box; padding: 0px;"><span style="display: inline-block; padding: 0.3em 0.5em; border-radius: 0.5em; color: rgb(255, 255, 255); text-align: inherit; font-size: 1em; box-shadow: rgb(165, 165, 165) 0.2em 0.2em 0.1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: rgb(71, 193, 168);"><p style="box-sizing: border-box;"><span style="font-size: 24px;">Living Music校园歌唱大赛半决赛距离开赛还有???</span></p></span></fieldset>
<p style="white-space: normal;"><br></p>
<fieldset style="white-space: normal; border: 0px; margin: 0px; clear: both; box-sizing: border-box; padding: 0px;"><section style="padding: 8px; margin: 0px; border-left-width: 6px; border-left-style: solid; border-color: rgb(71, 193, 168); font-size: 1em; line-height: 1.4; text-align: inherit; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: rgb(51, 51, 51); box-sizing: border-box;"><section style="box-sizing: border-box;"><p><span style="font-size: 18px; font-family: 宋体;">精彩绝伦的复赛没有来观看?没关系!30进15的淘汰赛已经结束,15进5的半决赛就在<span style="font-size: 36px; font-family: 宋体; color: rgb(49, 133, 155);"><strong>今晚!</strong></span></span></p></section></section></fieldset>
<p style="white-space: normal;"><img  class="profile_avatar lazy" src="/static/imghw/default1.png" data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxVbrSdHIQokUcfwqLgHDeHAOIct2NKByo5P7WOGqux1uqDFAfUH922afy36pc8Ge8t8nyNCxKK6Ng/0" data-s="300,640" data-type="jpeg" data- data-ratio="0.726790450928382" data-w="377" alt="正则表达式 - 如何用 php 抓取微信文章正文?" ><br></p>
<p style="white-space: normal;"><br></p>
<fieldset class="tn-Powered-by-XIUMI" style="white-space: normal; border: 0px; margin: 0px; clear: both; box-sizing: border-box; padding: 0px;"><section class="tn-Powered-by-XIUMI" style="padding: 8px; margin: 0px; border-left-width: 6px; border-left-style: solid; border-color: rgb(71, 193, 168); font-size: 1em; line-height: 1.4; text-align: inherit; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: rgb(51, 51, 51); box-sizing: border-box;"><section class="tn-Powered-by-XIUMI" style="box-sizing: border-box;"><p><span style="font-size: 36px;"><strong><span style="font-family: 宋体; color: rgb(49, 133, 155);">今晚六点半</span></strong></span><span style="font-size: 18px;"><strong><span style="font-family: 宋体; color: rgb(49, 133, 155);"></span></strong><span style="font-family: 宋体;">Living Music大赛花都校区的十五强选手将在<span style="font-size: 36px; font-family: 宋体; color: rgb(49, 133, 155);"><strong>实验楼105</strong></span>举行的半决赛当中角逐出进入最终决赛的五名选手,届时将和三水校区进入决赛的五名选手共同组成广工商十强歌手来竞争广工商<span style="font-size: 36px; font-family: 宋体; color: rgb(255, 0, 0);"><strong>最强音的宝座!!</strong></span></span></span></p></section></section></fieldset>
<p style="white-space: normal;"><img  src="/static/imghw/default1.png" data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxVicCIE0fvVEsL865N96Ds2cuLr8deLzfyGmmNLd5dKgP4m0FQ57uNewg4tMn2wiadSxhEMqptr1dxQ/0" class="lazy" data-s="300,640" data-type="jpeg" data- data-ratio="0.5964912280701754" data-w="456" alt="正则表达式 - 如何用 php 抓取微信文章正文?" ><br></p>
<fieldset class="tn-Powered-by-XIUMI" style="white-space: normal; border: 0px; margin: 0px; clear: both; box-sizing: border-box; padding: 0px;"><section class="tn-Powered-by-XIUMI" style="padding: 8px; margin: 0px; border-left-width: 6px; border-left-style: solid; border-color: rgb(71, 193, 168); font-size: 1em; line-height: 1.4; text-align: inherit; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: rgb(51, 51, 51); box-sizing: border-box;"><section class="tn-Powered-by-XIUMI" style="box-sizing: border-box;"><span style="font-size: 18px;">广工商最强音的诞生需要你的见证,come on 小伙伴,即使不是最专业的点评家,你也可以是<span style="font-size: 36px; color: rgb(49, 133, 155);"><strong>最专业的聆听者</strong></span><span style="font-size: 36px; color: rgb(49, 133, 155);">!</span></span></section></section></fieldset>
<p style="white-space: normal;"><img  src="/static/imghw/default1.png" data-src="http://mmbiz.qpic.cn/mmbiz/UeZYRwyWLxV1eIfFV9Do2a4aUp0koiadsKydXaDL3d696kOuEpXq5XSbrHk86fnicm6tG8ZPlQI6BsukIMlQmjGg/0" class="lazy" data-s="300,640" data-type="jpeg" data- data-ratio="1.0588235294117647" data-w="289" alt="正则表达式 - 如何用 php 抓取微信文章正文?" ><br></p>
<fieldset class="tn-Powered-by-XIUMI" style="color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; white-space: normal; border: 1px solid rgb(226, 226, 226); box-shadow: rgb(226, 226, 226) 0px 16px 1px -10px; line-height: 1.6; text-decoration: inherit; box-sizing: border-box; padding: 0px; background-color: rgb(255, 255, 255);">
<section class="tn-Powered-by-XIUMI" style="padding: 20px; color: rgb(255, 255, 255); text-align: center; font-weight: bold; line-height: 1.4; box-shadow: rgb(221, 221, 221) 0px 3px 3px; font-size: 1.4em; font-family: inherit; text-decoration: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: rgb(71, 193, 168);"><section class="tn-Powered-by-XIUMI" style="box-sizing: border-box;"><strong><span style="font-family: 宋体; font-size: 24px; line-height: 25.2000007629395px;"><span style="line-height: 28px;">Living Music大赛花都校区</span>15进5的半决赛</span></strong></section></section><p style="margin-top: 24px; text-align: inherit; font-size: 1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; line-height: 2em; background-color: transparent;"><img  class="tn-Powered-by-XIUMI lazy" src="/static/imghw/default1.png" data-src="http://mmbiz.qpic.cn/mmbiz/MVPvEL7Qg0GPLZlicQq2RYNicbDmd1xQT0Gicv1A0tlNRtyWzrwk4Odopjzzpwqo4YJkUl3x7nMbGeLATIszGPJ2Q/640" data- data-ratio="1" data-w="30"   style="max-width:90%" alt="正则表达式 - 如何用 php 抓取微信文章正文?" > <span style="line-height: 25.6000003814697px; color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; text-decoration: inherit;">4月27日18:30(即今晚)</span></p>
<p style="margin-top: 16px; text-align: inherit; font-size: 1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: transparent;"><img  class="tn-Powered-by-XIUMI lazy" src="/static/imghw/default1.png" data-src="http://mmbiz.qpic.cn/mmbiz/MVPvEL7Qg0GPLZlicQq2RYNicbDmd1xQT0xTVEAtw1fibKcv7QmGPZ2SPibJyDvCcAI1jgWFZxhxb1XSBViae9ibboJg/640" data- data-ratio="1" data-w="30"   style="max-width:90%" alt="正则表达式 - 如何用 php 抓取微信文章正文?" > <span style="line-height: 25.6000003814697px; color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; text-decoration: inherit;">实验楼105</span></p>
<p style="margin-top: 16px; text-align: inherit; font-size: 1em; font-family: inherit; font-weight: inherit; text-decoration: inherit; color: inherit; border-color: rgb(71, 193, 168); box-sizing: border-box; background-color: transparent;"><span style="line-height: 25.6000003814697px; color: inherit; font-family: inherit; font-size: 1em; font-weight: inherit; text-align: inherit; text-decoration: inherit;"><br></span></p>
</fieldset>
<p><br></p>
</div>                    <script type="text/javascript">
                        var first_sceen__time = (+new Date());
                    </script>                    <link rel="stylesheet" type="text/css" href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve_combo25624b.css">                                                                                                    <div class="rich_media_tool" id="js_toobar">                                                <div id="js_read_area" class="media_tool_meta tips_global meta_primary" style="display:none;">阅读 <span id="readNum"></span>
</div>                        <span style="display:none;" class="media_tool_meta meta_primary tips_global meta_praise" id="like">                            <i class="icon_praise_gray"></i><span class="praise_num" id="likeNum"></span>                        </span>                        <a id="js_report_article" style="display:none;" class="media_tool_meta tips_global meta_extra" href="javascript:void(0);">举报</a>                    </div>                </div>                <div class="rich_media_area_extra">                                        <div class="mpda_bottom_container" id="js_bottom_ad_area"></div>                                        <div id="js_iframetest" style="display:none;"></div>                                                        </div>                           </div>            <div id="js_pc_qr_code" class="qr_code_pc_outer" style="display:none;">                <div class="qr_code_pc_inner">                    <div class="qr_code_pc">                        <img  class="qr_code_pc_img lazy" src="/static/imghw/default1.png" data-src="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/moon230eaa.js" id="js_pc_qr_code_img" alt="正则表达式 - 如何用 php 抓取微信文章正文?" >                        <p>微信扫一扫<br>关注该公众号</p>                    </div>                </div>            </div>        </div>    </div>                <script>window.moon_map = {"a/gotoappdetail.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/gotoappdetail2562f8.js","a/ios.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/ios24a769.js","a/android.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/android22772d.js","a/profile.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/a/profile24a2ff.js","biz_common/utils/report.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/report224ef3.js","biz_common/utils/cookie.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/cookie224ef3.js","appmsg/reward_entry.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/reward_entry256315.js","appmsg/comment.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/comment255696.js","appmsg/like.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/like2340dc.js","appmsg/a.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/a25624b.js","biz_common/tmpl.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/tmpl224ef3.js","biz_common/ui/imgonepx.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/ui/imgonepx224ef3.js","biz_common/dom/attr.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/dom/attr22f190.js","biz_wap/utils/ajax.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/utils/ajax22589f.js","biz_common/utils/string/html.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/string/html224ef3.js","appmsg/report.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/report23c757.js","biz_common/dom/class.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/dom/class236751.js","appmsg/report_and_source.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/report_and_source23a582.js","appmsg/page_pos.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/page_pos253aa9.js","appmsg/cdn_speed_report.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/cdn_speed_report224ef3.js","appmsg/iframe.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/iframe24f185.js","appmsg/review_image.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/review_image2480be.js","appmsg/outer_link.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/outer_link224ef3.js","biz_wap/jsapi/core.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/jsapi/core22589f.js","biz_common/dom/event.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/dom/event24f08a.js","appmsg/async.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/async25624b.js","biz_wap/ui/lazyload_img.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/ui/lazyload_img23354e.js","biz_common/log/jserr.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/log/jserr22589f.js","appmsg/share.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/share251ea5.js","biz_wap/utils/mmversion.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_wap/utils/mmversion224ef3.js","appmsg/cdn_img_lib.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/cdn_img_lib23c757.js","biz_common/utils/url/parse.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/utils/url/parse238f07.js","appmsg/index.js":"http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/appmsg/index2567e4.js"};</script><script type="text/javascript"></script>    <script id="t_cmt" type="text/html">
        <li class="discuss_item" id="cid<# if (is_from_me == 1) { #><#=my_id#><# } else { #><#=content_id#><# } #>">
            <# if(is_elected == 1){ #>


<div class="discuss_opr">
                <span class="media_tool_meta tips_global meta_praise js_comment_praise <# if(like_status == 1){ #>praised<# } #>" data-status="<#=like_status#>" data-content-id='<#=content_id#>'>
                    <i class="icon_praise_gray">
                    <span class="praise_num"><# if(like_num_format !== 0){ #><#=like_num_format#> <# } #>
                
            


            <# } #>
            <div class="user_info">
                <strong class="nickname"><#=nick_name#><# if(is_from_friend == 1){ #>(朋友)<# } #>
                <img  class="avatar lazy"  src="/static/imghw/default1.png"  data-src="<#=logo_url# alt="正则表达式 - 如何用 php 抓取微信文章正文?" >" >
            
            <div class="discuss_message">
                <span class="discuss_status"><#=status#>
                <#=content#>
            
            <p class="discuss_extra_info">
                <#=time#>               
                <# if (is_from_me == 1) { #>
                <a class="discuss_del js_del" href="javascript:;" data-my-id="<#=my_id#>" data-content-id="<#=content_id#>">删除
                <# } #>
            
            <# if(reply && reply.reply_list && reply.rep</script></code>
登入後複製
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1664
14
CakePHP 教程
1423
52
Laravel 教程
1321
25
PHP教程
1269
29
C# 教程
1249
24
PHP和Python:比較兩種流行的編程語言 PHP和Python:比較兩種流行的編程語言 Apr 14, 2025 am 12:13 AM

PHP和Python各有優勢,選擇依據項目需求。 1.PHP適合web開發,尤其快速開發和維護網站。 2.Python適用於數據科學、機器學習和人工智能,語法簡潔,適合初學者。

PHP行動:現實世界中的示例和應用程序 PHP行動:現實世界中的示例和應用程序 Apr 14, 2025 am 12:19 AM

PHP在電子商務、內容管理系統和API開發中廣泛應用。 1)電子商務:用於購物車功能和支付處理。 2)內容管理系統:用於動態內容生成和用戶管理。 3)API開發:用於RESTfulAPI開發和API安全性。通過性能優化和最佳實踐,PHP應用的效率和可維護性得以提升。

PHP:網絡開發的關鍵語言 PHP:網絡開發的關鍵語言 Apr 13, 2025 am 12:08 AM

PHP是一種廣泛應用於服務器端的腳本語言,特別適合web開發。 1.PHP可以嵌入HTML,處理HTTP請求和響應,支持多種數據庫。 2.PHP用於生成動態網頁內容,處理表單數據,訪問數據庫等,具有強大的社區支持和開源資源。 3.PHP是解釋型語言,執行過程包括詞法分析、語法分析、編譯和執行。 4.PHP可以與MySQL結合用於用戶註冊系統等高級應用。 5.調試PHP時,可使用error_reporting()和var_dump()等函數。 6.優化PHP代碼可通過緩存機制、優化數據庫查詢和使用內置函數。 7

PHP的持久相關性:它還活著嗎? PHP的持久相關性:它還活著嗎? Apr 14, 2025 am 12:12 AM

PHP仍然具有活力,其在現代編程領域中依然佔據重要地位。 1)PHP的簡單易學和強大社區支持使其在Web開發中廣泛應用;2)其靈活性和穩定性使其在處理Web表單、數據庫操作和文件處理等方面表現出色;3)PHP不斷進化和優化,適用於初學者和經驗豐富的開發者。

PHP和Python:代碼示例和比較 PHP和Python:代碼示例和比較 Apr 15, 2025 am 12:07 AM

PHP和Python各有優劣,選擇取決於項目需求和個人偏好。 1.PHP適合快速開發和維護大型Web應用。 2.Python在數據科學和機器學習領域佔據主導地位。

PHP與其他語言:比較 PHP與其他語言:比較 Apr 13, 2025 am 12:19 AM

PHP適合web開發,特別是在快速開發和處理動態內容方面表現出色,但不擅長數據科學和企業級應用。與Python相比,PHP在web開發中更具優勢,但在數據科學領域不如Python;與Java相比,PHP在企業級應用中表現較差,但在web開發中更靈活;與JavaScript相比,PHP在後端開發中更簡潔,但在前端開發中不如JavaScript。

PHP和Python:解釋了不同的範例 PHP和Python:解釋了不同的範例 Apr 18, 2025 am 12:26 AM

PHP主要是過程式編程,但也支持面向對象編程(OOP);Python支持多種範式,包括OOP、函數式和過程式編程。 PHP適合web開發,Python適用於多種應用,如數據分析和機器學習。

PHP:處理數據庫和服務器端邏輯 PHP:處理數據庫和服務器端邏輯 Apr 15, 2025 am 12:15 AM

PHP在數據庫操作和服務器端邏輯處理中使用MySQLi和PDO擴展進行數據庫交互,並通過會話管理等功能處理服務器端邏輯。 1)使用MySQLi或PDO連接數據庫,執行SQL查詢。 2)通過會話管理等功能處理HTTP請求和用戶狀態。 3)使用事務確保數據庫操作的原子性。 4)防止SQL注入,使用異常處理和關閉連接來調試。 5)通過索引和緩存優化性能,編寫可讀性高的代碼並進行錯誤處理。

See all articles