[sebastian/diff]内容比较库,比较两段文本的历史变化

2022-04-03 奥古斯宏

sebastian/diff是一个用于对比两段文本变化的库,就像git的那样功能一样,可以用来对比文件变化。

使用方法非常简单:

<?php
use SebastianBergmann\Diff\Differ;

$differ = new Differ;
print $differ->diff('foo', 'bar');

最终输入效果如下:


还支持一些配置项,比如自定义头部,显示行号,很实用。

最近浏览
IP用户:43.130.*.*
22 小时前 Mobile Safari iOS 13.2
IP用户:115.192.*.*
1 天前 Internet Explorer Windows 7
IP用户:117.92.*.*
2 天前 Cheetah Browser Windows 8
IP用户:50.19.*.*
2 天前 Amazon Bot
IP用户:121.226.*.*
3 天前 Internet Explorer Windows 7
IP用户:117.86.*.*
4 天前 Internet Explorer Windows 7
IP用户:43.167.*.*
4 天前 Chrome Windows 10
IP用户:170.106.*.*
5 天前 Mobile Safari iOS 13.2
IP用户:175.155.*.*
5 天前 Internet Explorer Windows XP
IP用户:114.229.*.*
7 天前 Cheetah Browser Windows 8.1
IP用户:18.222.*.*
8 天前 Generic Bot
IP用户:112.86.*.*
8 天前 Sogou Spider
累计浏览次数:1680
评论
点击登录
phpreturn,PHP武器库,专注PHP领域的项目和资讯,收录和介绍PHP相关项目。
最近浏览 点击登录
累计浏览次数:224364
一周浏览次数:2016
今日浏览次数:73

本站所有权利归 phpreturn.com 所有

举报/反馈/投稿邮箱:phpreturn@ulthon.com

鲁ICP备19027671号-2