Home >Backend Development >PHP Tutorial >大家用php正则匹配链接地址,标题,和图片

大家用php正则匹配链接地址,标题,和图片

WBOY
WBOYOriginal
2016-06-13 11:55:431278browse

求助大家用php正则匹配链接地址,标题,和图片

大家用php正则匹配链接地址,标题,和图片


新手请大家帮助下,我正则很烂
------解决方案--------------------

$str =<<<str<br /> <a onclick="clickItemLink('193400209',this,'9124023729');" href="http://www.gome.com.cn/ec/rushbuy/limitbuy/itemdetail/includeDetail.jsp?limitBuyItemId=193400209" target="_blank" title="天绚春秋被(粉色)(200*230cm)国美自营,品质保障"><br /><img alt="天绚春秋被(粉色)(200*230cm)国美自营,品质保障" src="http://img2.gomein.net.cn/image/prodimg/production_image/201308/22/1113370286/1000508089_210.jpg" width="210px;" height="210px;"><br /></a><br />str;<br />preg_match_all('/href=\"([^"]+)\"<br><font color='#FF8000'>------解决方案--------------------</font><br>title=\"([^"]+)\"<br><font color='#FF8000'>------解决方案--------------------</font><br>src=\"([^"]+)\"/',$str,$match);<br />var_dump($match[0]);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn