Speed up development with full-stack environments for every branch.

Learn More

How to serialize / unserialize a WDDX packet [PHP]

Forked from How to add variables to a WDDX packet.

31 Runs 151 Views 30 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<?php
/*
PHP WDDX - How to serialize / unserialize a WDDX packet
*/

ini_set('display_errors',1);

$a = 1;
$b = 5.5;
$c = array("blue", "orange", "violet");
$d = "colors";
$clvars = array("c", "d");

//Serialize variables into a WDDX packet
$packet = wddx_serialize_vars("a", "b", $clvars);
echo "The serialized packet : <br />";
echo $packet;
echo "<br /><br />";

//Unserializes the WDDX packet
$packet = wddx_deserialize($packet);
echo "The unserialized packet : <br />";
var_dump($packet);

?>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).