将xml传递给url

时间:2014-08-01 02:10:42

标签: php file-get-contents json

我是xml的新手,我只想将一个对象传递给url并将其解析为数组。不知道该怎么办

这是我的代码:

$xml = "<user><name>".$name."</name><balance>".$balance."</balance><address>".$address."</address><mobile>".$mobile."</mobile></user>"; 
   $simple = new SimpleXMLElement($xml);
   $simple2 = $simple->asXML();
   $sample = simplexml_load_string($simple2);

$url = $GLOBALS['urlPath'].'webportal_sqlanywhere/xml.php?id='.$(my xml);
      $path_file = file_get_contents($url);
      echo $path_file;

0 个答案:

没有答案