These functions are intended for work with WDDX.
Note that all the functions that serialize variables use the first element of an array to determine whether the array is to be serialized into an array or structure. If the first element has string key, then it is serialized into a structure, otherwise, into an array.
Example 1. Serializing a single value
|
This example will produce:
1 2 <wddxPacket version='0.9'><header comment='PHP packet'/><data> 3 <string>PHP to WDDX packet example</string></data></wddxPacket> 4 |
Example 2. Using incremental packets
|
This example will produce:
1 2 <wddxPacket version='0.9'><header comment='PHP'/><data><struct> 3 <var name='pi'><number>3.1415926</number></var><var name='cities'> 4 <array length='3'><string>Austin</string><string>Novato</string> 5 <string>Seattle</string></array></var></struct></data></wddxPacket> 6 |