In PHP-Xpath, I am getting text between tags <br /> :
<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()
br[contains(.,'needle')]
following-sibling::*contains(.,'needle')/text()
Appreciate any help
Using
following-sibling::text()[contains(., 'needle')]