The call you need, I think, is:
$result = $xpath->query('//title[contains(.,"Site")]');
Please note that this is case sensitive.
Note that the contains XPath function takes two arguments: a haystack and a needle. In this case, we use the current text value of the node as a haystack, which is indicated by a period ( . ).
lonesomeday
source share