Skip to main content

Serialize variable

XML
<serialize var="var" var_result="var"/>

<serialize /> generates a storable representation of the value of a variable.

<serialize /> is the complement of the UNSERIALIZE operation.

Attributes

NameTypeDescriptionDefined By
varvarVariable name serialize
var_resultvarResult variable name serialize

Results

BindingTypePredicate
var_resultstringN/A

Examples

XML
<array var="names">
<item key="bg">Bill Gates</item>
<item key="sj">Steve Jobs</item>
</array>

<output>
<serialize var="names"/>
</output>

<!-- a:2:{s:2:"bg";s:10:"Bill Gates";s:2:"sj";s:10:"Steve Jobs";} -->