src/String/StringUtil.php
public function html2Text(string $html, array $options = [])
    {
        $html = str_replace("\n", '', $html); // remove white spaces from html
        $html = str_replace('</p>', '<br /></p>', $html); // interpret paragrah as block element
        $html = str_replace('</div>', '<br /></div>', $html); // interpret div as block element

        return \Soundasleep\Html2Text::convert($html, $options);
    }
public function html2Text(string $html, array $options = [])
    {
        $html = str_replace("\n", '', $html); // remove white spaces from html
        $html = str_replace('</p>', '<br /></p>', $html); // interpret paragrah as block element
        $html = str_replace('</div>', '<br /></div>', $html); // interpret div as block element

        return \Soundasleep\Html2Text::convert($html, $options);
    }
public function html2Text ( string $ html , array $ options = [ ] ) { $ html = str_replace ( "\n" , '' , $ html ) ; // remove white spaces from html $ html = str_replace ( '</p>' , '<br /></p>' , $ html ) ; // interpret paragrah as block element $ html = str_replace ( '</div>' , '<br /></div>' , $ html ) ; // interpret div as block element return \ Soundasleep \ Html2Text :: convert ( $ html , $ options ) ; }
Converts html to text.

@param string $html
@param array  $options

@throws \Soundasleep\Html2TextException

@return string
Converts html to text .