2017 © Pedro Peláez
 

library html2text

A PHP script to convert HTML into a plain text format

image

ahfeel/html2text

A PHP script to convert HTML into a plain text format

  • Tuesday, October 17, 2017
  • by ahfeel
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 83 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

html2text Build Status Total Downloads

html2text is a very simple script that uses PHP's DOM methods to load from HTML, and then iterates over the resulting DOM to correctly output plain text. For example:, (*1)

<html>
<title>Ignored Title</title>
<body>


Hello, World!

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

Even mismatched tags., (*2)

A div
Another div
A div
within a div
<a href="http://foo.com">A link</a> </body> </html>

Will be converted into:, (*3)

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)

See the original blog post or the related StackOverflow answer., (*4)

Installing

You can use Composer to add the package to your project:, (*5)

{
  "require": {
    "soundasleep/html2text": "~0.5"
  }
}

And then use it quite simply:, (*6)

$text = Html2Text\Html2Text::convert($html);

You can also include the supplied html2text.php and use $text = convert_html_to_text($html); instead., (*7)

Tests

Some very basic tests are provided in the tests/ directory. Run them with composer install --dev && vendor/bin/phpunit., (*8)

License

html2text is dual licensed under both EPL v1.0 and LGPL v3.0, making it suitable for both Eclipse and GPL projects., (*9)

Other versions

Also see html2text_ruby, a Ruby implementation., (*10)

The Versions

17/10 2017

dev-master

9999999-dev https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

20/04 2017

0.5.0

0.5.0.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

09/06 2016

0.3.4

0.3.4.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

08/06 2016

0.3.3

0.3.3.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

08/06 2016

0.3.2

0.3.2.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

25/02 2016

0.3.1

0.3.1.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

18/01 2016

dev-non-breaking-space

dev-non-breaking-space https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

18/12 2015

0.3.0

0.3.0.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

11/05 2015

0.2.3

0.2.3.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2
  • ext-dom *
  • ext-libxml *

 

The Development Requires

email php html text

15/12 2014

0.2.2

0.2.2.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2

 

The Development Requires

email php html text

10/12 2014

0.2.1

0.2.1.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2

 

email php html text

08/12 2014

0.2.0

0.2.0.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2

 

email php html text

30/05 2014

0.1.1

0.1.1.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2

 

email php html text

16/05 2014

0.1.0

0.1.0.0 https://github.com/soundasleep/html2text

A PHP script to convert HTML into a plain text format

  Sources   Download

EPL-1.0

The Requires

  • php >=5.3.2

 

email php html text