XML::jsonSerialize()
Returns the data to be serialized as JSON.
Table of Contents
Description
XML::jsonSerialize(): mixed;
This method is a requirement to be able to implement the JsonSerializable
interface and aims to make the data convertable to JSON. You won’t use this method directly, the json_encode()
function will call this method automatically.
Example
$node = new XML('<svg version="1.1"></svg>');
$test = json_encode($node); // Returns `'["svg","",{"version":"1.1"}]'`
XML::_()
The dynamic method initiator.
XML::__call()
Proxy for missing methods.
XML::__callStatic()
Proxy for missing static methods.
XML::__construct()
The constructor.
XML::__serialize()
Provides data to be serialized.
XML::__toString()
Converts the XML object to string.
XML::__unserialize()
Converts the serialized data back to its object.
XML::count()
Nothing.
XML::jsonSerialize()
Returns the data to be serialized as JSON.
XML::offsetExists()
Checks if an attribute exists.
XML::offsetGet()
Gets the attribute’s value.
XML::offsetSet()
Sets the attribute’s value.
XML::offsetUnset()
Deletes an attribute.