html2text/html2text

Converts HTML to formatted plain text

Installs: 24 121 947

Dependents: 91

Suggesters: 1

Security: 0

Stars: 561

Watchers: 23

Forks: 177

Open Issues: 17

4.3.2 2024-08-20 02:43 UTC

This package is not auto-updated.

Last update: 2024-10-01 03:32:44 UTC


README

A PHP library for converting HTML to formatted plain text.

Build status

Installing

composer require html2text/html2text

Basic Usage

$html = new \Html2Text\Html2Text('Hello, &quot;<b>world</b>&quot;');

echo $html->getText();  // Hello, "WORLD"

History

This library started life on the blog of Jon Abernathy http://www.chuggnutt.com/html2text

A number of projects picked up the library and started using it - among those was RoundCube mail. They made a number of updates to it over time to suit their webmail client.

Now it has been extracted as a standalone library. Hopefully it can be of use to others.