ph-7/html-to-text
Composer 安装命令:
composer require ph-7/html-to-text
包简介
Lightweight package to convert HTML code to plain text (handy for plain text email format).
README 文档
README
A simple, lightweight, and effective "HTML to Plain Text" converter for your PHP projects 🪄
📄 Overview
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?
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!
ph-7/html-to-text 适用场景与选型建议
ph-7/html-to-text 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.31k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2022 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「text」 「html」 「convert」 「plain text」 「converter」 「convertor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ph-7/html-to-text 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ph-7/html-to-text 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ph-7/html-to-text 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Provides a simple decimal/roman number converter
A library that provides a simple infrastructure to create your own converters and to perform any conversion you want
Convert xml to array
Common libraries used by Zimbra Api
HTML and form generation
统计信息
- 总下载量: 9.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 2
- 依赖项目数: 3
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-18
