PHP Interface IParser

Author: Kalashnikov Igor ([email protected])
Show file Open project: fubralimited/php-oara Interface Usage Examples

Public Methods

Method Description
serializeJson ( string $rootName, array $itemArray, array $attributes ) : string Serializes array to json string.
serializeXml ( string $rootName, array $itemArray, array $attributes ) : string Serializes array to XML.
unserializeJson ( string $jsonString ) : array Unserialize json string to array.
unserializeXml ( string $xml ) : array Unserialize xml to array.

Method Details

serializeJson() public method

Serializes array to json string.
public serializeJson ( string $rootName, array $itemArray, array $attributes ) : string
$rootName string name of root node
$itemArray array properties of item
$attributes array root node attributes
return string json string or false

serializeXml() public method

Serializes array to XML.
public serializeXml ( string $rootName, array $itemArray, array $attributes ) : string
$rootName string name of sub-root node (e.g. adspaceItem)
$itemArray array properties of item
$attributes array root node attributes
return string xml or false

unserializeJson() public method

Unserialize json string to array.
public unserializeJson ( string $jsonString ) : array
$jsonString string json string
return array array or false

unserializeXml() public method

Unserialize xml to array.
public unserializeXml ( string $xml ) : array
$xml string xml data to serialize
return array array or false