public class JSON

class.json.php #67

The JSON class takes a JSON formatted string and converts it to XML. The majority of this class was originally written by Brent Burgoyne, thank you.


public static
class.json.php #86
static string convertToXML(string $json, boolean $standalone)

Given a JSON formatted string, this function will convert it to an equivalent XML version (either standalone or as a fragment). The JSON will be added under a root node of <data>.

  • $json stringThe JSON formatted class

  • $standalone booleanIf passed true (which is the default), this parameter will cause the function to return the XML with an XML declaration, otherwise the XML will be returned as a fragment.


Returns a XML string

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details