private function get_Text()
    {
        $text_formatting = array('b','strong','em','i','small','strong','sub','sup','ins','del','mark','br','hr');

        foreach ($this->dom_element->childNodes as $node)
        {
            if($node->nodeType == 3)
            {
                $this->set_text(trim($node->textContent));
                $this->textFormatting.=$node->textContent;
            }
            else if($node->nodeType == 1 && !!in_array($node->tagName, $text_formatting))
            {
                if(!!in_array($node->tagName, ['br','hr']))
                {
                    $this->textFormatting.= sprintf('<%s>',$node->tagName);
                }
                else
                {
                    $tag = $node->tagName;
                    $attrs = $this->attrs_to_string($node->attributes);
                    $text = $node->textContent;

                    $this->textFormatting.= sprintf('<%1$s%2$s>%3$s</%1$s>',$tag,$attrs,$text);
                }
            }
        }

        return $this;
    }
private function get_Text()
    {
        $text_formatting = array('b','strong','em','i','small','strong','sub','sup','ins','del','mark','br','hr');

        foreach ($this->dom_element->childNodes as $node)
        {
            if($node->nodeType == 3)
            {
                $this->set_text(trim($node->textContent));
                $this->textFormatting.=$node->textContent;
            }
            else if($node->nodeType == 1 && !!in_array($node->tagName, $text_formatting))
            {
                if(!!in_array($node->tagName, ['br','hr']))
                {
                    $this->textFormatting.= sprintf('<%s>',$node->tagName);
                }
                else
                {
                    $tag = $node->tagName;
                    $attrs = $this->attrs_to_string($node->attributes);
                    $text = $node->textContent;

                    $this->textFormatting.= sprintf('<%1$s%2$s>%3$s</%1$s>',$tag,$attrs,$text);
                }
            }
        }

        return $this;
    }
private function get_Text ( ) { $ text_formatting = array ( 'b' , 'strong' , 'em' , 'i' , 'small' , 'strong' , 'sub' , 'sup' , 'ins' , 'del' , 'mark' , 'br' , 'hr' ) ; foreach ( $ this -> dom_element -> childNodes as $ node ) { if ( $ node -> nodeType == 3 ) { $ this -> set_text ( trim ( $ node -> textContent ) ) ; $ this -> textFormatting .= $ node -> textContent ; } else if ( $ node -> nodeType == 1 && ! ! in_array ( $ node -> tagName , $ text_formatting ) ) { if ( ! ! in_array ( $ node -> tagName , [ 'br' , 'hr' ] ) ) { $ this -> textFormatting .= sprintf ( '<%s>' , $ node -> tagName ) ; } else { $ tag = $ node -> tagName ; $ attrs = $ this -> attrs_to_string ( $ node -> attributes ) ; $ text = $ node -> textContent ; $ this -> textFormatting .= sprintf ( '<%1$s%2$s>%3$s</%1$s>' , $ tag , $ attrs , $ text ) ; } } } return $ this ; }
Metodo que permite obtener el texto que se encuentra dentro del elemento.
@return self
Metodo que permite obtener el texto que se encuentra dentro del elemento .