diff --git a/functions/wddx.xml b/functions/wddx.xml index 899f1ee020..b99aede0d8 100644 --- a/functions/wddx.xml +++ b/functions/wddx.xml @@ -1,19 +1,19 @@ - + - WDDX functions + WDDX Functions WDDX - These functions are intended for work with - WDDX. + These functions are intended for work with WDDX. In order to use WDDX, you will need to install the expat library - (which comes with apache 1.3.7 or higher) and recompile PHP with - and - . + (which comes with apache 1.3.7 or higher) and recompile PHP with + and . Note that all the functions that serialize variables use the first @@ -21,7 +21,6 @@ serialized into an array or structure. If the first element has string key, then it is serialized into a structure, otherwise, into an array. - Serializing a single value @@ -29,8 +28,8 @@ print wddx_serialize_value("PHP to WDDX packet example", "PHP packet"); ?> - - + + This example will produce: @@ -56,11 +55,10 @@ $packet = wddx_packet_end($packet_id); print $packet; ?> - - + + This example will produce: - <wddxPacket version='1.0'><header comment='PHP'/><data><struct> @@ -68,8 +66,8 @@ print $packet; <array length='3'><string>Austin</string><string>Novato</string> <string>Seattle</string></array></var></struct></data></wddxPacket> - - + + @@ -88,14 +86,13 @@ print $packet; comment - wddx_serialize_value is used to create a WDDX packet from a single given value. It takes the value contained in var, and an optional comment string that appears in the packet - header, and returns the WDDX packet. - + header, and returns the WDDX packet. + @@ -115,18 +112,17 @@ print $packet; - wddx_serialize_vars is used to create a WDDX packet with a structure that contains the serialized - representation of the passed variables. - + representation of the passed variables. + wddx_serialize_vars takes a variable number of arguments, each of which can be either a string naming a variable or an array containing strings naming the variables or - another array, etc. - + another array, etc. + wddx_serialize_vars example @@ -141,8 +137,8 @@ $clvars = array("c", "d"); print wddx_serialize_vars("a", "b", $clvars); ?> - - + + The above example will produce: @@ -150,8 +146,8 @@ print wddx_serialize_vars("a", "b", $clvars); <var name='b'><number>5.5</number></var><var name='c'><array length='3'> <string>blue</string><string>orange</string><string>violet</string></array></var> <var name='d'><string>colors</string></var></struct></data></wddxPacket> - - + + @@ -171,7 +167,6 @@ print wddx_serialize_vars("a", "b", $clvars); comment - Use wddx_packet_start to start a new WDDX packet for incremental addition of variables. It takes an @@ -195,12 +190,11 @@ print wddx_serialize_vars("a", "b", $clvars); int packet_id - wddx_packet_end ends the WDDX packet specified by the packet_id and returns the - string with the packet. - + string with the packet. + @@ -223,14 +217,13 @@ print wddx_serialize_vars("a", "b", $clvars); - wddx_add_vars is used to serialize passed variables and add the result to the packet specified by the packet_id. The variables to be serialized are specified in exactly the same way as - wddx_serialize_vars. - + wddx_serialize_vars. + @@ -247,13 +240,12 @@ print wddx_serialize_vars("a", "b", $clvars); string packet - wddx_deserialize takes a packet string and deserializes it. It returns the result which can be string, number, or array. Note - that structures are deserialized into associative arrays. - + that structures are deserialized into associative arrays. +