I need to check if an array of DOMNode
objects contains all the items in a similar array of DOMNode
objects.
In general, to check if an array contains another array, I've tried some of the methods outlined in this question. However, both array_intersect()
and array_diff()
compare array items on the bases (string) $elem1 === (string) $elem2
- which throws the following error for DOMElements
as they can't be converted to strings.
PHP Catchable fatal error:
Object of class DOMElement could not be converted to string in...
What would be the proper way of handling this?