Coder Social home page Coder Social logo

wisquimas / simplehtmltotext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robquistnl/simplehtmltotext

0.0 1.0 0.0 13 KB

A simple PHP class for transforming HTML to plain text (e.g. for emails)

License: MIT License

PHP 81.11% HTML 18.89%

simplehtmltotext's Introduction

SimpleHtmlToText

Build Status Latest Stable Version Total Downloads License

A simple PHP class for transforming HTML to plain text (e.g. for emails)

Installation

Install using composer (composer require robquistnl/simplehtmltotext).

Usage

$myHtml = '<b>This is HTML</b><h1>Header</h1><br/><br/>Newlines';
echo (new Parser())->parseString($myHtml);

Returns:

**This is HTML**
### Header ###


Newlines

Supported tags

Currently only a few basic tags are supported, and no CSS is checked.

  • br
  • hr
  • h1, h2, h3, h4, h5, h6
  • table, tr, td, th (Very basic support)
  • b, strong, u, i, em
  • a Simple support; <a href="http://example.org">Click here</a> becomes Click here (http://example.org)
  • img Simple support; <img src="http://example.org/image.jpg"> becomes and <img alt="title" src="http://example.org/image.jpg"> becomes (title)
  • ul, ol, li, dd, dt

simplehtmltotext's People

Contributors

robquistnl avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.