<?php $doc = new DOMDocument("1.0"); $node = $doc->createElement("foo"); $newnode = $doc->appendChild($node); $newnode->setAttribute("bar", "baz"); var_dump($newnode->getAttribute('bar')); var_dump(method_exists($newnode, 'getAttribute')); var_dump(get_class($newnode));
You have javascript disabled. You will not be able to edit any code.