开发者

How do I get the line number of a DOMElement?

开发者 https://www.devze.com 2023-01-23 20:05 出处:网络
I\'m trying to get the line number of a DOMElement object in PHP - the documentati开发者_如何学Pythonon says DOMElement extends DOMNode which implements the getLineNo() method, however, when I try to

I'm trying to get the line number of a DOMElement object in PHP - the documentati开发者_如何学Pythonon says DOMElement extends DOMNode which implements the getLineNo() method, however, when I try to use this method I get:

Fatal error: Call to undefined method DOMElement::getLineNo()


Upgrade to PHP 5.3 or higher, see the documentation. On a side note: dynamically added nodes (i.e. not in the XML document or string on load) will return 0.

0

精彩评论

暂无评论...
验证码 换一张
取 消