Jump to content

PHP Problem


goran133

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.