Source Code:
(back to article)
<?php $xml = new SimpleXMLElement('<books xmlns:bk="https://www.example.com/books"><book><bk:title>PHP Basics</bk:title><bk:author>John Doe</bk:author></book></books>'); $namespaces = $xml->getDocNamespaces(true); foreach($namespaces as $namespace) { echo $namespace . "\n"; }
Result:
Report an issue