PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP HTML to Text   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP HTML to Text
Convert HTML string to text from the HTML document
Author: By
Last change:
Date: 1 year ago
Size: 2,085 bytes
 

Contents

Class file image Download

HTML to Plain Text

A simple lightweight "HTML to Plain Text" converter ?

? Overview

Ko Fi - Offer Me A Coffee

Simple. Clean. Efficient. Just what you need to convert HTML code into plain text ?

? PHP Requirement

? Installation

composer require ph-7/html-to-text

If you don't already use composer in your project, include Composer's autoload as shown below in your main PHP index file of your project.

require __DIR__ . '/vendor/autoload.php';

? Usage

use PH7\HtmlToText\Convert;

$htmlCode = '<div><p><em>Some random paragraphs...</em></p></div>';

$this->html2Text = new Convert($htmlCode);
$plainText = $this->html2Text->getText();

echo $plainText;

? Who cooked it?

Pierre-Henry Soria

[![@phenrysay][twitter-image]](https://twitter.com/phenrysay) [![pH-7][github-image]](https://github.com/pH-7)

Pierre-Henry Soria. A super passionate, zen &amp; pragmatic software engineer ? Cheese & dark chocolate lover! ???

??? Are you enjoying it...? You could offer me a coffee if you wish ?

Projects using it ?

?? License

HTML to Text is generously distributed under _MIT_ ? Enjoy!

<!-- GitHub's Markdown reference links --> [twitter-image]: https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white [github-image]: https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white