Parsing XML in CI |
[eluser]aryan_[/eluser]
Does Codeigniter has xml parser? I want to parse xml file and show its data.
[eluser]skunkbad[/eluser]
I think using the built in SimpleXML class is very easy. www.php.net/simplexml It parses XML very nicely.
[eluser]imn.codeartist[/eluser]
yes, you can create your own library using simpleXML
[eluser]aryan_[/eluser]
I did this. Why don't CI has inbuilt XML parsing class?
[eluser]kyleect[/eluser]
Might as well use this thread for my question. Does anyone know of a way to convert a simplexml object to an array? Or, it easier, does anyone know of an alternate way to parse XML to an array in PHP? Thanks!
[eluser]skunkbad[/eluser]
[quote author="aryan_" date="1254672713"]I did this. Why don't CI has inbuilt XML parsing class?[/quote] Probably because php has one that works great, and in my opinion doesn't need to be changed. My car tires are already round. You get me?
[eluser]pistolPete[/eluser]
@kyleect: Why do you need an array? Why would you prefer an array to an object?
[eluser]skunkbad[/eluser]
Ya know, I guess I hadn't really thought about the CI users who do not have php5. SimpleXML is a php5 class, so perhaps CI users should create a class/library that parses XML like SimpleXML, but for php4. I have used a class like this in the past. I found it online, and probably have it somewhere in my mega script library. If I can find it, I will post it.
[eluser]skunkbad[/eluser]
[quote author="InsiteFX" date="1254710349"]Here you go skunkbad, is the one your talking about? XML PHP4 Enjoy InsiteFX[/quote] Ah yes! Thank you for finding my post! Yes, this class does allow for parsing XML in php4, very similar to php5 SimpleXML usage. |
Welcome Guest, Not a member yet? Register Sign In |