wddx_packet_end

string wddx_packet_end(int packetID) 

Ends the specified WDDX packet and returns the string containing it.

Returns:

String containing the WDDX packet

Description:

This functions finalizes the packet identified with the passed argument, and returns a string containing the full WDDX packet.

Version:

Existing since versions 3.0.7 and 4.0

Example:

Create a WDDX packet
/* OUTPUT 
<wddxPacket version='1.0'> 
<header/> 
<data> 
<struct> 
<var name='foo'><string>FOO</string></var> 
</struct> 
</data> 
</wddxPacket> 
*/ 

// assign variable 
$foo = "FOO"; 

$id = wddx_packet_start(); 
wddx_add_vars($id, "foo"); 

// output packet 
print(wddx_packet_end($id)); 

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.