PHP Classes

What is the best PHP array to xml class?: Generate XML from the multi dimensional

Recommend this page to a friend!
  All requests RSS feed  >  What is the best PHP array to xml class?  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

What is the best PHP array to xml class?

Edit

Picture of zeeshan by zeeshan - 8 years ago (2015-04-16)

Generate XML from the multi dimensional

This request is clear and relevant.
This request is not clear or is not relevant.

+2

I am looking for a class to generate XML from the multi dimensional array.

Ask clarification

1 Recommendation

QXML: XML <> Array (preserve attrib.), JSON, etc.

This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Manuel Lemos by Manuel Lemos Reputation 23325 - 8 years ago (2015-08-16) Comment

There are so many classes for that purpose that it is hard to recommend one.

This one seems to provide a very extensive set of features that you may not need but may be useful in other contexts.

  • 2 Comments
  • 1. Picture of Martin Barker by Martin Barker - 8 years ago (2015-08-21) Reply

    The problem with this Request is the distinction i think QXML is a good one for it but if you pass an array and want it converting to XML are the values to be an attribute of the tag or another tag inside the tag

    E.G (array("test" = > array("attr" = 1, "value" = 2));

    Could be <test><attr>1</attr><value>2</value></test> or <test attr="1"><value>2</value></test> or <test attr=1 value="2"/>

  • 2. Picture of Manuel Lemos by Manuel Lemos - 8 years ago (2015-08-21) in reply to comment 1 by Martin Barker Reply

    Yes, the array must have a specific structure if you want to generate both children tags and attributes.


Recommend package
: 
: