定制 robquistnl/simplehtmltotext 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

robquistnl/simplehtmltotext

最新稳定版本:v1.1.1

Composer 安装命令:

composer require robquistnl/simplehtmltotext

包简介

A Simple PHP Class to transform HTML to Text

README 文档

README

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

统计信息

  • 总下载量: 108.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-21