PHP/Utility Function/WDDX — различия между версиями

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

Текущая версия на 07:07, 26 мая 2010

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"); 
?>