【发布时间】:2014-10-06 21:55:40
【问题描述】:
假设我们想要获取 HTML 页面的 div,span,p,etc,该页面的 class 或 ID 名称包含一些关键字,如:
one & two & three
例如我有这个 HTML:
<div class="this_one">
Need this !
</div>
<div id="some_three">
Need this again !
</div>
<span id="two_this">
Need again
</span>
<p class="NOT">
Not want this
</p>
我的意思是我想在特殊标签内获取文本,例如 (div,p,span),它们的 ID 或 CLASS 包含我的单词,例如 (one,two,...)
如何检测它们?
例如,使用 simpledom 或 PHPDOM 或任何您想要的方式。
【问题讨论】:
标签: php html css dom simpledom