我想从字符串中读取一些值。字符串现在是xml格式。如何从中获得艺术家?
<?xml version="1.0" encoding="UTF-8" ?>
<song>
<filename>c699da47ed08bd80927ae148c1b5b0fd.mp3</filename>
<title>Interlude (Imam Siraj)</title>
<artist>Native Deen</artist>
<album>Not Afraid To Stand Alone</album>
<year>2007</year>
<genre>R&B</genre>
<duration>0:01:20 (approx)</duration>
</song>
我尝试过使用simplexml,但不知道如何在其中获取元素。
$xml=simplexml_load_string($strXML);$strArtist=???
请阅读手册simplexml-load-string()
$strArtist = $xml->artist