2024-11-27 13:02:40
我需要你xml格式的内容。
给个参考给你吧!这是我的xml数据,我想获取key节点,orig节点的值
<dict num="219" id="219" name="219">
<key>你好</key>
<pos></pos>
<acceptation>Array;Array;Array;</acceptation>
<sent>
<orig>Haven't seen you for a long time. How are you?</orig>
<trans>多日不见了,你好吗?</trans>
</sent>
<sent>
<orig>Haven't seen you for a long time. How are you?</orig>
<trans>多日不见了,你好吗?</trans>
</sent>
</dict>
$xmldata = simplexml_load_string($data);//$data就是这个xml
key节点:$xmldata->key
第一个orig节点:$xmldata->sent[0]->orig