PHPackages                             apt142/htmltotext - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. apt142/htmltotext

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

apt142/htmltotext
=================

A PHP class to convert HTML into a plain text format

0.1.1(11y ago)312.6k↓100%EPL-1.0PHPPHP &gt;=5.3.2

Since May 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/apt142/HtmlToText)[ Packagist](https://packagist.org/packages/apt142/htmltotext)[ Docs](https://github.com/soundasleep/html2text)[ RSS](/packages/apt142-htmltotext/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

\#HtmlToText [![Build Status](https://camo.githubusercontent.com/0ce14b95e08a6357a024e9bdda037ef3cae6731e6ae0e6afd2949dd2f22a2479/68747470733a2f2f7472617669732d63692e6f72672f6170743134322f48746d6c546f546578742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/apt142/HtmlToText)[![Latest Stable Version](https://camo.githubusercontent.com/a9242ab47ff487980dd38179aa6824bb16037f4af2432615dcb59298a17772bf/68747470733a2f2f706f7365722e707567782e6f72672f6170743134322f68746d6c746f746578742f762f737461626c652e706e67)](https://packagist.org/packages/apt142/htmltotext)[![Total Downloads](https://camo.githubusercontent.com/051e52d9366bcb973d7570963c240af300ed1f13122d6f38a745cd680112d010/68747470733a2f2f706f7365722e707567782e6f72672f6170743134322f68746d6c746f746578742f646f776e6c6f6164732e706e67)](https://packagist.org/packages/apt142/htmltotext)[![License](https://camo.githubusercontent.com/54d6a481c3d922414c9bb3c40fe77540bedcc5806200e70c74e3d739cd5613ca/68747470733a2f2f706f7365722e707567782e6f72672f6170743134322f68746d6c746f746578742f6c6963656e73652e706e67)](https://packagist.org/packages/apt142/htmltotext)

html2text is a very simple script that uses PHP's DOM methods to load from HTML, and then iterates over the resulting DOM to output plain text.

Example:

```

Ignored Title

  Hello, World!

  This is some e-mail content.
  Even though it has whitespace and newlines, the e-mail converter
  will handle it correctly.

  Even mismatched tags.

  A div
  Another div
  A divwithin a div

  A link

```

Will be converted into:

```
Hello, World!

This is some e-mail content. Even though it has whitespace and newlines, the e-mail converter will handle it correctly.

Even mismatched tags.
A div
Another div
A div
within a div
[A link](http://foo.com)

```

This is a fork of: ()

Installing
----------

[](#installing)

You can use [Composer](http://getcomposer.org/) to add the [package](https://packagist.org/packages/soundasleep/jsonrpcclient) to your project:

```
{
  "require": {
    "apt142/htmltotext": "dev-master"
  }
}
```

And then use it quite simply:

```
$converter = new \HtmlToText\HtmlToText($html);
$text = $converter->convert();

// Or

$converter = new \HtmlToText\HtmlToText();
$convertor->set($html);
$text = $converter->convert();
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

2

Last Release

4362d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dec75239ccc85f4ce5a0868eb3ee79f782cf772cc8285313b6b9e8180905eec?d=identicon)[apt142](/maintainers/apt142)

---

Top Contributors

[![apt142](https://avatars.githubusercontent.com/u/1025650?v=4)](https://github.com/apt142 "apt142 (24 commits)")[![soundasleep](https://avatars.githubusercontent.com/u/3889656?v=4)](https://github.com/soundasleep "soundasleep (16 commits)")

---

Tags

phpemailhtmltext

### Embed Badge

![Health badge](/badges/apt142-htmltotext/health.svg)

```
[![Health](https://phpackages.com/badges/apt142-htmltotext/health.svg)](https://phpackages.com/packages/apt142-htmltotext)
```

###  Alternatives

[soundasleep/html2text

A PHP script to convert HTML into a plain text format

48419.5M73](/packages/soundasleep-html2text)[voku/html2text

Only a Fork of -&gt; html2text: Converts HTML to formatted plain text

39335.8k2](/packages/voku-html2text)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

23125.7k2](/packages/henrique-borba-php-sieve-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
