-1

xml来源:

<nodes>
<TUR>
<node>
<kaynakad>Veri</kaynakad>
<rast>xxx1</rast>
<saat>18:50</saat>
</node>
<node>
<kaynakad>Veri</kaynakad>
<rast>xxx5</rast>
<saat>18:50</saat>
</node>
</TUR>
</nodes>

在循环中使用:

<?php foreach ($ev->TUR->children() as $node) { ?>

节目:

<?php echo $kaynakad=$node->kaynakad. '</br>'; ?>
<?php echo $rast=$node->rast. '</br>'; ?>
<?php echo $saat=$node->saat. '</br>'; ?>

kaynakadsaat没问题。但是,问题。

我该如何解决?

4

1 回答 1

1

我建议:simplexml_load_string

<?php
$string = <<<XML
<?xml version='1.0'?> 
<document>
 <title>Forty What?</title>
 <from>Joe</from>
 <to>Jane</to>
 <body>
  I know that's the answer -- but what's the question?
 </body>
</document>
XML;

$xml = simplexml_load_string($string);

print_r($xml);
?>
于 2013-02-11T21:26:35.257 回答