PHP/Network/wddx deserialize

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

wddx_deserialize function demo

 
<?php
$fp = fopen ( "http://localhost/remote.php", "rt" );
if ($fp) {
  $wddx = "";
  while ( ! feof ( $fp ) ) {
    $wddx .= fread ( $fp, 4096 );
  }
  fclose ( $fp );
  $wddx = wddx_deserialize ( $wddx );
  for($m = 0; $m < 12; $m ++) {
    printf ( "The sale in %s was %d\n", $wddx ["months"] [$m], $wddx ["sales"] [$m] );
  }
}
?>