wddx_serialize_value

string wddx_serialize_value(mixed var, [string comment]) 
var Name of variable to add
comment Comment

Serializes a single variable into a WDDX packet.

Returns:

String containing WDDX packet; FALSE on error

Description:

This function transforms a single variable, passed as the first argument, into a WDDX packet of the matching datatype. You can specify an optional comment as the second argument.

Version:

Existing since versions 3.0.7 and 4.0

Example:

Serialize a variable
/* OUTPUT 
<wddxPacket version='1.0'> 
<header/> 
<data><string>FOO</string></data> 
</wddxPacket> 
*/ 

$foo = "foo"; 
print(wddx_serialize_value("FOO")); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.