gan_node_html.php
function setOuterText($text, $parser = null) {
		if (trim($text)) {
			$index = $this->index();
			if ($parser === null) {
				$parser = new $this->parserClass();
			}
			$parser->setDoc($text);
			$parser->parse_all();
			$parser->root->moveChildren($this->parent, $index);
		}
		$this->delete();
		return (($parser && $parser->errors) ? $parser->errors : true);
	}
function setOuterText($text, $parser = null) {
		if (trim($text)) {
			$index = $this->index();
			if ($parser === null) {
				$parser = new $this->parserClass();
			}
			$parser->setDoc($text);
			$parser->parse_all();
			$parser->root->moveChildren($this->parent, $index);
		}
		$this->delete();
		return (($parser && $parser->errors) ? $parser->errors : true);
	}
function setOuterText ( $ text , $ parser = null ) { if ( trim ( $ text ) ) { $ index = $ this -> index ( ) ; if ( $ parser === null ) { $ parser = new $ this -> parserClass ( ) ; } $ parser -> setDoc ( $ text ) ; $ parser -> parse_all ( ) ; $ parser -> root -> moveChildren ( $ this -> parent , $ index ) ; } $ this -> delete ( ) ; return ( ( $ parser && $ parser -> errors ) ? $ parser -> errors : true ) ; }
Similar to JavaScript outerText, will replace node (and child nodes) with new text
@param string $text
@param HtmlParserBase $parser Null to auto create instance
@return bool|array True on succeed, array with errors on failure
Similar to JavaScript outerText will replace node ( and child nodes ) with new text