[請益] 請問php的simpleXML取某種標籤的問題

看板PHP作者 (jims)時間13年前 (2010/09/16 13:53), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我處理的格式裡面有一種 xml:lang的屬性 但我試過幾種simplexml的方法都取不出 想請教各位,這樣的標籤要如何取? 例子: <?xml version="1.0" encoding="UTF-8"?> <response xmlns:dc='http://purl.org/dc/elements/1.1/' > <obj> <dc:title xml:lang="en" id = "5555">book</dc:title> </obj> phpcode: $xml = simplexml_load_string(XML字串); $sub_dc = $xml->obj->children("dc",TRUE); //我試了以下這個,只能取出id的屬性 $tt = $sub_dc->title->attributes(); -- X ※ 編輯: jimshsu 來自: 140.109.29.151 (09/16 13:55)
文章代碼(AID): #1CaR3dGv (PHP)