首页 >后端开发 >php教程 >php采集问题,遇到代码中的多个空格和换行怎么处理?

php采集问题,遇到代码中的多个空格和换行怎么处理?

WBOY
WBOY原创
2016-10-11 14:02:151068浏览

源代码是:

<code><a class="figure  figure-180236 " data-qidanadd-albumid="543438400" data-qidanadd-episode="0" data-qidanadd-channelid="1" data-qidanadd-tvid="543438400" data-qidanadd-vip="0" data-widget-qidanadd="qidanadd" data-widget-block="block" data-block-type="qs1404043" data-searchpingback-elem="link" data-searchpingback-param="ptype=1-1" href="http://www.iqiyi.com/v_19rr9g9wks.html?fc=87451bff3f7d2f4a#vfrm=2-3-0-1" data-playsrc-linktype="play" data-playsrc-elem="pic" data-pb="rtgt=iqiyi&p2=9000" target="_blank"></a></code>

采集php代码是:

<code>preg_match("#<a class='\"figure' figure-180236 data-qidanadd-albumid='\"543438400\"' data-qidanadd-episode='\"0\"' data-qidanadd-channelid='\"1\"' data-qidanadd-tvid='\"543438400\"' data-qidanadd-vip='\"0\"' data-widget-qidanadd='\"qidanadd\"' data-widget-block='\"block\"' data-block-type='\"qs1404043\"' data-searchpingback-elem='\"link\"' data-searchpingback-param='\"ptype=1-1\"' href="%5C%22(.*?)%5C%22" data-playsrc-linktype='\"play\"' data-playsrc-elem='\"pic\"' data-pb='\"rtgt=iqiyi&p2=9000\"' target='\"_blank\"'>#",$content,$array);</a></code>

但是这样的话采集不到信息?求解

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn