【问题标题】:Php Html Parser "find next"Php Html 解析器“查找下一个”
【发布时间】:2020-09-04 10:35:29
【问题描述】:

我正在使用 paquettg/php-html-parser 来解析 php 中的 html jquery 样式。

我找不到与 jquery 的 next() 类似的函数。例如下面 jquery 中的 next("p") 等价物:

var string=$("span#a").parent().next("p").text();

有吗?

【问题讨论】:

    标签: php jquery dom


    【解决方案1】:

    我认为您在 PHP 中寻找的是 DOMElement 类。具体来说,我认为您正在寻找 DOMNode() 方法。

    此方法查找紧跟在此节点之后的节点。如果没有这样的节点,则返回 NULL。

    我可能会建议您查看这张票,以了解如何实施此方法来完成您的任务Select the next node of the selected node in PHP DOM?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-18
      • 2010-12-24
      • 2015-12-08
      • 2019-12-18
      • 1970-01-01
      • 2015-08-25
      • 1970-01-01
      • 2020-03-02
      相关资源
      最近更新 更多