ph-7/html-to-text
Lightweight package to convert HTML code to plain text (handy for plain text email format).
Maintainers
Requires
- php: >=7.4.0
Requires (Dev)
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT de61eab436ca8c5475b5c819eb0946c330e0c514
- Pierre-Henry Soria <hi.woop@ph7.me>
texthtmlconvertplain textconverterconvertorhtml2texthtml to text
README
A simple, lightweight, and effective "HTML to Plain Text" converter for your PHP projects ๐ช
๐ Overview
๐ Ko Fi - Offer Me A Coffee
Simple. Clean. Efficient. Just what you need to convert HTML code into plain text ๐งน
๐ PHP Requirement
- PHP v7.4 or newer.
๐ 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?
๐ @phenrysay
๐ @pH7Programming
๐ pH-7
Pierre-Henry Soria. A super passionate, zen & 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!
