dongyouzhi7218 2014-06-27 09:48
浏览 56
已采纳

使用Simple HTML DOM Parser检索值

How to retrieve value with Simple HTML DOM parser.

Example:

<td  class="tabData" valign="top"><a href="anouncement.asp?s=51&id=1635872">some string</a>&nbsp;&nbsp;</td>

I need value: Some string.

Problem are values 51 and id = "1635872" are not constant.

  • 写回答

1条回答 默认 最新

  • duanliao6077 2014-06-27 09:52
    关注

    Assuming the DOM is in $dom:

    $value = $dom->find("td.tabData a", 0)->plainText
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?