![]() |
Simple XML helpers? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Simple XML helpers? (/showthread.php?tid=9482) |
Simple XML helpers? - El Forum - 06-26-2008 [eluser]Unknown[/eluser] I was working on some simple XML functions today. I'm pulling data out of a database and wanted to easily be able to mash up some XML with that data, so I came up with the following: Code: <?php Basically, this code takes an associative array and turns it into a pretty XML string. It's extremely basic and lacks some important functionality, but I'm posting this here because it might be useful for someone. Here's an example of its usage: Code: <?php I think this would make a nice helper. It's not a full solution for all your XML needs, but it's a simple and handy solution in some cases. Simple XML helpers? - El Forum - 06-26-2008 [eluser]got 2 doodle[/eluser] Excellent, I haven't tried it yet but I will use this! Thanks, doodle Welcome aboard! Simple XML helpers? - El Forum - 06-26-2008 [eluser]RaZoR LeGaCy[/eluser] You can look into using Zend_Feed I merged two xml data arrays in to one. Simple XML helpers? - El Forum - 06-26-2008 [eluser]Colin Williams[/eluser] And what's wrong with using SimpleXML? http://us2.php.net/simplexml Simple XML helpers? - El Forum - 06-27-2008 [eluser]Unknown[/eluser] [quote author="Colin Williams" date="1214534773"]And what's wrong with using SimpleXML? http://us2.php.net/simplexml[/quote]Well, nothing, really, but this is even simpler. You could think of this as SimplerXML. |