wddx_serialize_vars

string wddx_serialize_vars(mixed var1, [...]) 

Serializes one or more variables into a WDDX STRUCT packet.

Returns:

String containing WDDX packet; FALSE on error

Description:

This function takes one or more variable names as arguments, and serializes the variables into a WDDX STRUCT packet. Alternatively, you can pass the variable names in an array.

Version:

Existing since versions 3.0.7 and 4.0

Example:

Serialize variables
/* OUTPUT 
<wddxPacket version='1.0'> 
<header/> 
<data> 
<struct> 
<var name='foo'><string>foo</string></var> 
<var name='bar'><string>bar</string></var> 
</struct> 
</data> 
</wddxPacket> 
*/ 

$foo = "foo"; 
$bar = "bar"; 
print(wddx_serialize_vars("foo", array('bar"))); 

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.