I'm a newbie in PHP and I just learn about WDDX and try a few stuff, serialize a packet and deserialize it from a different file. It worked when I deserialize it in one single file, but when I try to deserialize a packet from other site, it didn't work. Here's the code I try from tutorial sites :
/ This code is in
http://pentium-ii/ta/test.php file /
<?php
$pi = 3.14;
$packet_id = wddx_packet_start("PHP");
wddx_add_vars($packet_id,"pi");
$packet = wddx_packet_end($packet_id);
echo $packet;
?>
/ This code is in
http://pentium-ii/test/getpacket.php file /
<?php
$url = "http://pentium-ii/ta/test.php";
$packet = implode("",file($url));
$value = wddx_deserialize($packet);
print "pi is : " . $value["pi"] . ";
?>
It said that the output should be like this :
pi is : 3.14
But I only got this :
pi is :
Then how come I dont get the output? I didn't get the pi value, I dont know where the error is. Can someone help me? Thank you very very much.