Answer the question
In order to leave comments, you need to log in
How are $xpath->query(...) queries different from $xpath->evaluate(...)?
Hello!
Tell me, please, in simple, human language, how do requests differ $xpath->query(...)
from $xpath->evaluate(...)
?
Thank you!
Answer the question
In order to leave comments, you need to log in
query - performs a query on a document.
evaluate - performs, I don’t even know how to say in Russian, the calculation of an expression.
the main difference is in the return value:
query returns a DOMNodeList (even empty) or an error.
evaluate returns either the result (if any), or a DOMNodeList, or an error.
example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question