franktiao / html-diff
Compare two html text and return a merged html text.(对比两个html文本,返回一个合并差异后的html文本)
v1.0.4
2020-06-03 05:19 UTC
Requires
- php: >=7.0
- ext-iconv: *
- ext-mbstring: *
README
Compare two html text and return a merged html text.
对比两个html文本,返回一个合并差异后的html文本
预览 Preview
安装 Installation
composer require franktiao/html-diff
快速开始 Quick start
use htmlDiff\HtmlDiff;
require __DIR__.'/../vendor/autoload.php';
try {
$diff = new HtmlDiff();
$res = $diff->diff('Some text old', 'Some text new');
} catch (\Exception $e) {
print_r($e->getMessage()); die;
}
print_r($res);
更多使用方式请查看 example 目录
For more usage, please see example directory
更新记录 Update record
- v1.0.0--2020-02-19
A
基础版本
- v1.0.1--2020-02-20
F
修复了HtmlDiff对象在单例中获取到脏数据的BUG
- v1.0.2--2020-02-20
F
修复了单边标签(如img)不会对比的BUGA
内置了常用单边标签:img
、br
、hr
、link
、mete
,不常用的单边标签可调用$htmlDiff->setUnilateralTags()
自定义追加