views:

454

answers:

2

Hi!

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

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.

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

+4  A: 

Options:

Stackoverflow Archive:

Jonathan Sampson
mmmm .. not sure if it hightlights as well
Wbdvlpr
Thanks a lot Jonathan. I'll try which one works for me.
Wbdvlpr
I wish you all the best.
Jonathan Sampson
+2  A: 

If you are familiar with GNU/Linux tools, you might be familiar with the `diff' tool.

And someone has written a fully functional diff for comparing files/strings in php.

You can find it here: php diff example.

ryanli