PHP Simple Html Dom get the plain text of div,but avoiding all other tags

前端 未结 4 378
庸人自扰
庸人自扰 2020-12-21 05:35

I use PHP Simple Html Dom to get some html,now i have a html dom like follow code,i need fetch the plain text inner div,but avoiding the p tags and their content(only retur

4条回答
  •  北海茫月
    2020-12-21 06:13

    If you text is always at the same position , try this:

    $html->find('text', 2)->plaintext; // should return 111111
    

提交回复
热议问题