XMLFormatter
    
            
            in package
            
        
    
            
            implements
                            FormatterInterface                    
    
    
XML data formatter
Tags
Table of Contents
Interfaces
- FormatterInterface
- Formatter interface
Methods
- format() : false|non-empty-string
- Takes the given data and formats it.
- arrayToXML() : void
- 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(array<string|int, mixed>|object|string $data) : false|non-empty-string
    Parameters
- $data : array<string|int, mixed>|object|string
Return values
false|non-empty-stringarrayToXML()
A recursive method to convert an array into a valid XML string.
    protected
                    arrayToXML(array<string|int, mixed> $data, SimpleXMLElement &$output) : void
    Written by CodexWorld. Received permission by email on Nov 24, 2016 to use this code.
Parameters
- $data : array<string|int, mixed>
- $output : SimpleXMLElement
Tags
normalizeXMLTag()
Normalizes tags into the allowed by W3C.
    protected
                    normalizeXMLTag(int|string $key) : string
    Regex adopted from this StackOverflow answer.
Parameters
- $key : int|string