goran133 Posted April 21, 2010 Share Posted April 21, 2010 How can i get the value of attribute of an element that is a child of another element in php? This is XML: <telefonski_imenik> <osoba OIB="84302530153" kategorija="obitelj"> <ime>Goran</ime> <prezime>xxxxxxx</prezime> <telefon tip="fiksni"> <broj pozivni="04x">xxxxxxx</broj> </telefon> <telefon tip="mobilni"> <broj pozivni="09x">xxxxxxx</broj> </telefon> <osoba> I need the value of attribute "pozivni". In PHP instruction: print($node->getAttribute('OIB')); returns the value of attribut "OIB", but when i want the attribut "pozivni" that won't work because the attribute "pozivni" is an attribute of the element broj. How can i get the value of attribute "pozivni"??? thanks! Link to comment https://forums.phpfreaks.com/topic/199317-php-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.