Object of class DOMElement could not be converted to string Object of class DOMElement could not be converted to string php php

Object of class DOMElement could not be converted to string


$link is an object which can not be converted to string (some objects can).

To see which object it is, use var_dump($link);. I assume it's a DOMElementDocs, see the link for all properties and methods it has to offer, e.g.

echo $link->tagName;

or

echo $link->textContent;