PHP/Utility Function/WDDX

Материал из Web эксперт
Перейти к: навигация, поиск

Transfer data from one server to another.

 
<?php
$fp = fopen ( "http://localhost/remote.php", "rt" );
if ($fp) {
  $wddx = "";
  while ( ! feof ( $fp ) ) {
    $wddx .= fread ( $fp, 4096 );
  }
  fclose ( $fp );
  echo utf8_decode ( wddx_deserialize ( $wddx ) );
}
?>



WDDX Functions in PHP

 
Name                       Description 
wddx_add_vars()            Adds variables to a WDDX packet with the specified ID 
wddx_deserialize()         Deserializes a WDDX packet 
wddx_packet_end()          Ends a WDDX packet with the specified ID 
wddx_packet_start()        Starts a new WDDX packet with structure inside it 
wddx_serialize_value()     Serializes a single value into a WDDX packet 
wddx_serialize_vars()      Serializes variables into a WDDX packet 

<?php 
$var = "Creating a WDDX document with a single value."; 
echo wddx_serialize_value(utf8_encode($var), "PHP Packet"); 
?>