PHP code example of usox / html2text

1. Go to this page and download the library: Download usox/html2text library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

usox / html2text example snippets


$converter = new \Usox\Html2Text()
$text = $converter->convert($html);

$html = 'some fine html';
$options = dict[
  'ignore_errors' => true,
  // other options go here
];
$converter = new \Usox\Html2Text()
echo $converter->convert($html, $options);