threeheartsdigital / html-to-plaintext-conversion-service
Converts HTML to formatted plain text
Installs: 94 015
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 177
pkg:composer/threeheartsdigital/html-to-plaintext-conversion-service
Requires
- php: ^8.2
- ext-mbstring: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.3
This package is not auto-updated.
Last update: 2025-11-07 19:43:34 UTC
README
A PHP library for converting HTML to formatted plain text.
Basic Usage
$html = (new \ThreeHeartsDigital\HtmlToPlaintextConversionService())->setHtml('Hello, "<b>world</b>"'); echo $html->getPlainText(); // 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.