Documentation

XMLFormatter
in package
implements FormatterInterface

XML data formatter

Interfaces, Classes and Traits

FormatterInterface
Formatter interface

Table of Contents

format()  : string|bool
Takes the given data and formats it.
arrayToXML()  : mixed
A recursive method to convert an array into a valid XML string.
normalizeXMLTag()  : string
Normalizes tags into the allowed by W3C.

Methods

format()

Takes the given data and formats it.

public format(mixed $data) : string|bool
Parameters
$data : mixed
Return values
string|bool

(XML string | false)

arrayToXML()

A recursive method to convert an array into a valid XML string.

protected arrayToXML(array<string|int, mixed> $data, SimpleXMLElement &$output) : mixed

Written by CodexWorld. Received permission by email on Nov 24, 2016 to use this code.

Parameters
$data : array<string|int, mixed>
$output : SimpleXMLElement
Tags
see
http://www.codexworld.com/convert-array-to-xml-in-php/
Return values
mixed

Search results