Code has been added to clipboard!

Attribute Value in XML Files

Example
<?php
  $xml = simplexml_load_file('bookstore.xml') or die('Failed to create an object');
  echo $xml->book[0]['category'] . "<br>";
  echo $xml->book[1]->name['lang']; 
?>