PHP/XML/XML Attributes

Материал из Web эксперт
Перейти к: навигация, поиск

Print XML attributes

   <source lang="html4strict">

<?php

  $xml = simplexml_load_file("books.xml");
  foreach($xml->book[0]->author->attributes() AS $a => $b) {
     echo "$a = $b 
"; }

?>


      </source>