假定这个xml是一个字串 $xml$xml = new SimpleXMLElement($xml);$autoPlay = $xml->attributes()->autoPlay;$autoNextSong = $xml->attributes()->autoNextSong;这样你获取的会是两个对象, 如果需要用来做某些特定的事情, 比如显示echo (string)$autoPlay;