使用CodeIgniter解析XML文件? [英] Parsing XML files using CodeIgniter?
问题描述
搜索互联网,我发现。这里是一个PHP的SimpleXML的例子。如果您对SimpleXML(PHP,不是CodeIgniter的敲诈)有任何疑问,请阅读手册的示例十二次,如果仍然没有找到您,请发表新的问题。
$ Comprobante = simplexml_load_file('yourfile.xml');
echo $ Comprobante-> Emisor ['nombre'];
Searching the, Internet ,I found http://blog.insicdesigns.com/2009/03/parsing-xml-file-using-codeigniters-simplexml-library/, but I have a lot of questions. I am new to codeigniter, and I am trying to adapt my code to this xml. I want to display once a user logins, but the question is, how would I iterate through a series of child nodes with attributes?
A little code will be really helpfull
The class you've linked to is for PHP 4. If you're using PHP 4, obviously you should upgrade now. PHP 5 users should use the real deal, SimpleXML. Here's an example for PHP's SimpleXML. If you have questions about SimpleXML (PHP's, not CodeIgniter's knockoff) read the manual's examples a dozen times and if it still doesn't come to you, please post a new question.
$Comprobante = simplexml_load_file('yourfile.xml');
echo $Comprobante->Emisor['nombre'];
这篇关于使用CodeIgniter解析XML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!