반응형
<접두어:앨리어스>
<접두어:앨리어스>
</접두어:앨리어스>
<접두어:앨리어스>
형식의 xml을 parsing할 때 잘 되지 않아서 xpath라는 것을 사용하면 한번에 해결이 된다.
$xml = new SimpleXMLElement($r);
foreach($xml->xpath('//event:event') as $event) {
var_export($event->xpath('event:sessionKey'));
}
xPath - http://linuxism.tistory.com/1203
참고 사이트 : http://stackoverflow.com/questions/595946/parse-xml-with-namespace-using-simplexml
반응형
'Old > PHP' 카테고리의 다른 글
특정 문자열 사이에 있는 값 가져오기 (0) | 2013.03.15 |
---|---|
문자열을 배열로 반환 (0) | 2013.03.15 |
virtual host 설정 (0) | 2013.03.13 |
phpstorm debugger 설정 (0) | 2013.03.12 |
PHP XDebug 셋팅 환경 설정 (0) | 2013.03.12 |