求正责表达式

xiachao2008 2012-04-27 09:18:54
匹配 这个连接里的 http://so.letv.com/list/c2_t28_a-1_y-1_f_at_o1_p.html
这个里面的 “共25集全”就是列表图片上面显示的文字。



下面的代码来至于 这个连接:http://so.letv.com/list/c2_t28_a-1_y-1_f_at_o1_p.html


<dl class="m_dl">

<dt>

<a href="http://so.letv.com/tv/44734.html"

title="暗流" target="_blank"><img

src="http://img1.c3.letv.com/ptv/letv_vrs/2011/7/tv/1112ccf654294486989818d3d5a58c35.jpg"

alt="暗流"

onerror="this.src='http://img1.c0.letv.com/ptv/images/nlist/onpic.jpg';" />



<em></em>



<i>共25集全</i>









<b class="null"></b>



</a>

</dt>

<dd>

<strong><a href="http://so.letv.com/tv/44734.html"

title="暗流" target="_blank">暗流</a>

</strong>

</dd>

<dd>

主演:



<a href="http://so.letv.com/star?wd=%E5%91%A8%E8%8E%89&from=list"

target="_blank" title="周莉" >周莉</a>



<a href="http://so.letv.com/star?wd=%E6%96%87%E7%AB%A0&from=list"

target="_blank" title="文章" >文章</a>



</dd>



<dd>

评价:

<span class="sorce2"><i>5.3</i> </span>

</dd>

</dl>



<dl class="m_dl">

<dt>

<a href="http://so.letv.com/tv/47973.html"

title="复仇第1季" target="_blank"><img

src="http://img1.c3.letv.com/ptv/letv_vrs/2011/9/b53d231d391842d38db397682f6836cc.jpg"

alt="复仇第1季"

onerror="this.src='http://img1.c0.letv.com/ptv/images/nlist/onpic.jpg';" />



<em></em>



<i> 更新到18集</i>









<b class="null"></b>



</a>

</dt>

...全文
114 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiachao2008 2012-04-28
  • 打赏
  • 举报
回复
写出来是错的,
[Quote=引用 3 楼 的回复:]

为什吗不自己写- -
[/Quote]
hllfl 2012-04-28
  • 打赏
  • 举报
回复
正则~?
qq120848369 2012-04-27
  • 打赏
  • 举报
回复
为什吗不自己写- -
代码如诗 2012-04-27
  • 打赏
  • 举报
回复
<?php
$str=file_get_contents('http://so.letv.com/list/c2_t28_a-1_y-1_f_at_o1_p.html');
preg_match_all('/<\/em>\s*<i>(.*)<\/i>/sU',$str,$matchs);
print_r($matchs[1]);
这样??
一起混吧 2012-04-27
  • 打赏
  • 举报
回复
哪个文字? “共25集全”“ 更新到18集”这些?

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧