Can I generate associative array out of a DOMDocument obj?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
HubGoblin
Forum Newbie
Posts: 7
Joined: Fri Apr 14, 2006 9:27 am

Can I generate associative array out of a DOMDocument obj?

Post by HubGoblin »

So here is the problem.

I need to make some sort of sanitization of the data in xml tags to prevent some undesired charcters etc. So my idea is to load the xml document into dom object and to create an associative array from the dom and to make a recursive function which will walk through to all array elements and make some sanitization. After that I will generate the xml tree again.

So is this a good idea or there is another better and faster solution? Thanks in advance.
Post Reply