hamza221 / html2text
Converts HTML to formatted plain text
v1.0.0
2023-08-16 11:30 UTC
Requires (Dev)
- phpunit/phpunit: ~4|^9.0
Suggests
- ext-mbstring: For best performance
- symfony/polyfill-mbstring: If you can't install ext-mbstring
This package is auto-updated.
Last update: 2025-02-24 17:17:09 UTC
README
A PHP library for converting HTML to formatted plain text.
Installing
composer require hamza221/html2text
Basic Usage
$html = new \Html2Text\Html2Text('Hello, "<b>world</b>"'); 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.