You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php/*** @class DOMNodeWrapper* @author Robert McLeod <[email protected]>* @date 23/04/2010* @version 0.1b* @copyright 2009 Robert McLeod*/class DOMNodeWrapper { // original node is kept here public $n = null; function __construct($DOMNode) { $this->n = $DOMNode; /* Backwards compatibility */ $this->nodeValue = $DOMNode->nodeValue; } /** * Get a named attribute from the node * * @return string */ function a( $attr ) { return $this->n->getAttribute($attr); } /** * Access a property that would go into * getAttribute. Special properties are * at the top. * * @param string $name The name of the property to get */ function __get( $name ) { switch ($name) { case 'inner': return $this->n->nodeValue; case 'plain': return strip_tags($this->n->nodeValue); default: return $this->a($name); } }}?>