Search code examples
phpxmlwddx

PHP how to create WDDX XML file and read WDDX XML file to object?


create xml
$country="Australia";
$va=wddx_serialize_value($country);
$data="data.xml";
$fp=fopen($data, "w+") or die("can't open file");
fwrite($fp, $va, strlen($va));
fclose($fp);

how can I get back the value "Australia" by read the xml file? Thanks


Solution

  • $va = file_get_contents("data.xml");
    $country = wddx_deserialize($va);