\EasyWeChat\SupportXML

Class XML.

Summary

Methods
Properties
Constants
parse()
build()
cdata()
No public properties found
No constants found
normalize()
data2Xml()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

parse()

parse(string  $xml) : array|\SimpleXMLElement

XML to array.

Parameters

string $xml

XML string

Returns

array|\SimpleXMLElement

build()

build(mixed  $data, string  $root = 'xml', string  $item = 'item', string  $attr = '', string  $id = 'id') : string

XML encode.

Parameters

mixed $data
string $root
string $item
string $attr
string $id

Returns

string

cdata()

cdata(string  $string) : string

Build CDATA.

Parameters

string $string

Returns

string

normalize()

normalize(\SimpleXMLElement  $obj) : array

Object to array.

Parameters

\SimpleXMLElement $obj

Returns

array

data2Xml()

data2Xml(array  $data, string  $item = 'item', string  $id = 'id') : string

Array to XML.

Parameters

array $data
string $item
string $id

Returns

string