note 110958 modified in book.simplexml by danbrown
| From: | danbrown@php.net | Date: | Thu, 17 Jan 2013 15:28:51 +0000 |
| Subject: | note 110958 modified in book.simplexml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193152@lists.php.net to get a copy of this message | ||
Simple means simple. If you know the structure and just want the value of a tag:
<?php
$xml = simplexml_load_file($xmlfile);
print $xml->City->Street->Address->HouseColor;
?>
Warning, numbers can come out as strings, empty elements like <HouseColor></HouseColor>
come out as array(0)
--was--
Simple means simple. If you know the structure and just want the value of a tag:
$xml = simplexml_load_file($xmlfile);
print $xml->City->Street->Address->HouseColor;
Warning, numbers can come out as strings, empty elements like <HouseColor></HouseColor>
come out as array(0)
http://php.net/manual/en/book.simplexml.php