getDocNamespaces()

It returns the children of a specified node

Example

<?php
$xml = simplexml_load_file(‘test.xml’);
echo “<pre>”;
print_r($xml->getDocNamespaces());
?>

Output

Array
(
[b] => http://www.phpcodez.com/

XML

<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<web xmlns:b=”http://www.phpcodez.com/”>
<server ver=”5″>Apache</server>
<lan>PHP</lan>
<client>Javascript</client>
</web>


Share