Having issues getting links that match a given word to display using Xpath and domDocument. Everything seems to work up to where for($i=0;$i<$documentLinks->leng
for($i=0;$i<$documentLinks->leng
You can fetch the href attribute directly via XPath
//ol/li[starts-with(@id, "stuff")]/a[contains(@href, "domain")]/@href
and then just do
foreach($result as $href){ echo $href->nodeValue; }
Note that contains function is case-sensitive though.
contains