0

我有这样的html代码块

 <tr>
   <td style="padding: 11px 8px 11px 15px; color: #000; width: 92px; border-bottom: solid   1px #ccd9e2;"> Name </td>
   <td style="color: #666;border-bottom: solid 1px #ccd9e2;"> Lusine Akopyan </td>
 </tr>

解析名称我使用这样的代码preg_match("/Name<\/td>(.+?)<\/td>/is", $html, $match);

但是$matchvar中什么都没有,我做错了吗?

4

1 回答 1

0

Maybe try something like:

preg_match_all("/<td[^>]*>( Name )<\/td>/", $html, $match);

or

preg_match_all("/<td[^>]*>(.*?)<\/td>/", $html, $match);

to get all content within each TD element

于 2012-08-29T12:43:52.407 回答