调用未定义的方法 SimpleXMLElement::child_nodes()
我有一个代码可以解析从 google 搜索获得的 xml 文本 它以前工作正常,我想更新我的版本信息后它工作不正常
可能是什么问题我收到以下错误
Fatal error: Call to undefined method SimpleXMLElement::child_nodes() in /home/search.php in line 70
请让我知道如何解决这个问题
此代码用于 smarty 它从curl 获取响应字符串。
i am having a code which parses the xml text which is obtained from google search
it used to working fine before , I think after updating my version infos it not working fine
what might be the problem i am getting the following error
Fatal error: Call to undefined method SimpleXMLElement::child_nodes() in /home/search.php in line 70
Please let me know how can i solve this problem
This code is used in smarty
And it gets the response string from curl.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用以下符号来迭代您的 xml(更改“myfile.xml”和“tagName”):
还有其他更优雅的方法来实现此目的,但这是一个简单的初学者方法。有关技术信息: https://www.php.net/manual/en/类.simplexmlelement.php
use the following notation to iterate thru your xml (change 'myfile.xml' and 'tagName'):
there are other more elegant ways to achieve this, but this is a simple beginner's way to do it. for technical info: https://www.php.net/manual/en/class.simplexmlelement.php
SimpleXMLElement 没有名为
child_nodes
。您是否在寻找children
方法?SimpleXMLElement does not have a method called
child_nodes
. Were you looking for thechildren
method?好的,非常感谢您的回答。
我通过使用 domxml-php4-to-php5.php 文件解决了我的问题,我刚刚上传了该文件并将该文件名包含在我的文件中。结果成功了。
我从这个链接得到了该文件: http://alexandre.alapetite.fr/ doc-alex/domxml-php4-php5/
:)
okay many thanx for your answers .
i got solved my problem by using the domxml-php4-to-php5.php file i have just uploaded this file and included that file name in my file . And it got worked .
I got that file from this link : http://alexandre.alapetite.fr/doc-alex/domxml-php4-php5/
:)