public function getInnerText($e, $normalizeSpaces = true, $flattenLines = false)
    {
        if (null === $e || !isset($e->textContent) || '' === $e->textContent) {
            return '';
        }

        $textContent = trim($e->textContent);

        if ($flattenLines) {
            $textContent = mb_ereg_replace('(?:[\r\n](?:\s|&nbsp;)*)+', '', $textContent);
        } elseif ($normalizeSpaces) {
            $textContent = mb_ereg_replace('\s\s+', ' ', $textContent);
        }

        return $textContent;
    }
public function getInnerText($e, $normalizeSpaces = true, $flattenLines = false)
    {
        if (null === $e || !isset($e->textContent) || '' === $e->textContent) {
            return '';
        }

        $textContent = trim($e->textContent);

        if ($flattenLines) {
            $textContent = mb_ereg_replace('(?:[\r\n](?:\s|&nbsp;)*)+', '', $textContent);
        } elseif ($normalizeSpaces) {
            $textContent = mb_ereg_replace('\s\s+', ' ', $textContent);
        }

        return $textContent;
    }
public function getInnerText ( $ e , $ normalizeSpaces = true , $ flattenLines = false ) { if ( null === $ e || ! isset ( $ e -> textContent ) || '' === $ e -> textContent ) { return '' ; } $ textContent = trim ( $ e -> textContent ) ; if ( $ flattenLines ) { $ textContent = mb_ereg_replace ( '(?:[\r\n](?:\s|&nbsp;)*)+' , '' , $ textContent ) ; } elseif ( $ normalizeSpaces ) { $ textContent = mb_ereg_replace ( '\s\s+' , ' ' , $ textContent ) ; } return $ textContent ; }
Get the inner text of a node.
This also strips out any excess whitespace to be found.

@param \DOMElement $e
@param bool        $normalizeSpaces (default: true)
@param bool        $flattenLines    (default: false)

@return string
Get the inner text of a node . This also strips out any excess whitespace to be found .