如何突出一个文本段落中的更改/差异从另一个? [英] How to highlight changes/difference in one text paragraph from the other?

查看:113
本文介绍了如何突出一个文本段落中的更改/差异从另一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以从另一个文本段落突出显示一个文本段落中的修改吗?

Is it possible to highlight the modifications in one text paragraph from the other?

例如,数据库中有3个文本字段。非管理员用户可以编辑文本并提交审批。当管理员登录时,他可以打开审批页面,它显示原始文本和用户提交的文本修改。通常这些修改在性质上非常小,例如拼写校正或者只是删除或添加句子。

For example, there are 3 text fields in a database. Non-admin users can edit the text and submit for approval. When the admin logs in, (s)he can open the approvals page and it shows the original text and user submitted text with modifications. Usually these modifications are very small in nature, like spelling correction or just a deletion or addition of a sentence.

它可以以这样一种方式呈现,原始文本)高亮显示,以便管理员用户不必检查每个字段和每行前批准它?

Can it be presented in such a way that the modifications (from the original text) are highlighted so that admin users don't have to check every field and every line before they approve it?

任何帮助将不胜感激。
谢谢。

Any help would be appreciated. Thanks.

更新:
有点类似于TortoiseSVN的代码更改突出显示。

Updated: Somewhat similar to TortoiseSVN's code changes highlighting.

推荐答案

选项:

  • PHP Inline Diff (uses PEAR text-diff)
  • PEAR Text_Diff
  • Diff in Pure PHP
  • xdiff_string_diff()

Stackoverflow存档:

Stackoverflow Archive:

  • Highlight the difference between two strings in PHP
  • Apply Diff in PHP
  • Need Help Optimizing php string difference function

这篇关于如何突出一个文本段落中的更改/差异从另一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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