snebes/php-daisydiff
最新稳定版本:v1.0.0
Composer 安装命令:
composer require snebes/php-daisydiff
包简介
PHP DaisyDiff Port
README 文档
README
Daisy Diff is a PHP implementation of the Java library that diffs (compares) HTML files. It highlights added and removed words and annotates changes to the styling.
Installation
You can add this library as a local, per-project dependency to your project using Composer:
composer require snebes/php-daisydiff
Usage
The DaisyDiff class can be used to generate a textual representation of the difference between two HTML strings:
<?php use SN\DaisyDiff\DaisyDiff; $original = '<html><body>The original document</body></html>'; $modified = '<html><body>The changed document</body></html>'; $daisyDiff = new DaisyDiff(); \printf("%s\n", $daisyDiff->diff($original, $modified));
The code above yields the output below:
<html>The <del class="diff-html-removed">original </del><ins class="diff-html-added">changed </ins>document</html>
Thanks
Many thanks to:
- Java DaisyDiff, the original Java version of the DaisyDiff library.
- gdevanla/assist from which many of the tests of this library are extracted.
统计信息
- 总下载量: 5.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-30