Home >Backend Development >PHP Tutorial >PHP collection problem, how to deal with multiple spaces and line breaks in the code?
The source code is:
<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"></code>
The collection php code is:
<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=\"(.*?)\" data-playsrc-linktype=\"play\" data-playsrc-elem=\"pic\" data-pb=\"rtgt=iqiyi&p2=9000\" target=\"_blank\">#",$content,$array);</code>
But the information cannot be collected in this case? Solve