Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 593 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 593 Bytes

ArrayAsXml

ArrayAsXml is a simple PHP class that converts array to XML.

Based on SimpleXML.

Installation

via Composer

composer require overbid/arrayasxml

Usage

Load the library

require 'vendor/autoload.php';
use Overbid\ArrayAsXml;

Set custom configuration:

$arrayAsXml = new ArrayAsXml();
$arrayAsXml->setEncoding('TIS-620');  //default UTF-8
$arrayAsXml->setRootName('main');     //defaul root

Creat XML

echo $arrayAsXml->save($data);