src/SimpleDOM.php
public function innerHTML()
    {
        $dom = dom_import_simplexml($this);
        $doc = $dom->ownerDocument;

        $html = '';
        foreach ($dom->childNodes as $child) {
            $html .= ($child instanceof DOMText) ? $child->textContent : $doc->saveXML($child);
        }

        return $html;
    }
public function innerHTML()
    {
        $dom = dom_import_simplexml($this);
        $doc = $dom->ownerDocument;

        $html = '';
        foreach ($dom->childNodes as $child) {
            $html .= ($child instanceof DOMText) ? $child->textContent : $doc->saveXML($child);
        }

        return $html;
    }
Return the content of current node as a string

Roughly emulates the innerHTML property found in browsers, although it is not meant to
perfectly match any specific implementation.

@todo Write a test for HTML entities that can't be represented in the document's encoding

@return    string            Content of current node