计算PHP中的文本差异 [英] Calculate text diffs in PHP

查看:69
本文介绍了计算PHP中的文本差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP中是否有任何库(第三方或内置库)来计算文本差异?

Are there any libraries (3rd party or built-in) in PHP to calculate text diffs?

推荐答案

什么样的差异?文件差异?有 array_diff()可以对数组起作用.然后还有 xdiff ,它使您能够创建和应用补丁文件包含不同版本的文件之间的差异.".后者作用于文件或字符串.

What sort of diffs? File diffs? There is array_diff() which acts on arrays. Then there is also xdiff, which "enables you to create and apply patch files containing differences between different revisions of files.". The latter acts on files or strings.

我应该添加xdiff似乎尚未发布.您必须从源代码开始构建才能使用它.

I should add xdiff doesn't appear to be out in a release yet. You have to build from source to use it.

这篇关于计算PHP中的文本差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆