Next-sibling :: text () only if contains a needle

In PHP-Xpath, I am getting text between tags <br />

:

//*/br/following-sibling::text()

      

How can I get this text only if it contains a "needle"?

Something like br[contains(.,'needle')]

- or -following-sibling::*contains(.,'needle')/text()

Appreciate any help

+3


source to share


1 answer


Using



following-sibling::text()[contains(., 'needle')]

      

+8


source







All Articles