Parse XML with Namespace using SimpleXML

前端 未结 6 966
独厮守ぢ
独厮守ぢ 2020-11-21 23:45

I have this as xml:


    
        &         


        
6条回答
  •  逝去的感伤
    2020-11-22 00:49

    here alternative that worked for me.

    $xml = simplexml_load_string($r);
    $ns = $xml->getNamespaces(true);
    
    foreach ($xml->children($ns['event'])->event as $skey) {
        $sessionKey = $skey->children($ns['event'])->sessionKey;
        echo $sessionKey;
    }
    

提交回复
热议问题