猿问

simplexml_load_string( )函数问题?

simplexml_load_string( )函数问题


慕斯709654
浏览 1138回答 3
3回答

HUX布斯

我需要你xml格式的内容。给个参考给你吧!这是我的xml数据,我想获取key节点,orig节点的值12345678910111213<dict&nbsp;num="219"&nbsp;id="219"&nbsp;name="219">&nbsp;<key>你好</key>&nbsp;<pos></pos>&nbsp;<acceptation>Array;Array;Array;</acceptation>&nbsp;<sent>&nbsp;&nbsp;<orig>Haven't&nbsp;seen&nbsp;you&nbsp;for&nbsp;a&nbsp;long&nbsp;time.&nbsp;How&nbsp;are&nbsp;you?</orig>&nbsp;&nbsp;<trans>多日不见了,你好吗?</trans>&nbsp;</sent>&nbsp;&nbsp;<sent>&nbsp;&nbsp;<orig>Haven't&nbsp;seen&nbsp;you&nbsp;for&nbsp;a&nbsp;long&nbsp;time.&nbsp;How&nbsp;are&nbsp;you?</orig>&nbsp;&nbsp;<trans>多日不见了,你好吗?</trans>&nbsp;</sent></dict>$xmldata = simplexml_load_string($data);//$data就是这个xmlkey节点:$xmldata->key第一个orig节点:$xmldata->sent[0]->orig
随时随地看视频慕课网APP
我要回答