PHP / Wordpress - Loading a remote XML file

女生的网名这么多〃 提交于 2019-12-23 05:25:46

问题


How can a get a object variable from a remote XML file, for example this one ?

In PHP5 it works fine with simplexml_load_file(), but I need this to work in PHP 4 also. How can I do that? Or is there any built-in WordPress function that can load xml files? I tried using the WP's SimplePie class, but I get a weird object variable (with incorectly named fields etc).


回答1:


If you want to use the smipleXML functions in PHP4 include this class ( I have used it and it works like a charm) http://www.phpclasses.org/package/4484-PHP-Load-XML-files-in-PHP-4-like-SimpleXML-extension.html



来源:https://stackoverflow.com/questions/3797845/php-wordpress-loading-a-remote-xml-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!