Domanda

StackExchange has introduced an interesting edit system, as authors can review the edits made to his/her post, by marking the words changed (red for old words, and green for new words). How does this system work?

I think that the system does not record the list of changes/edits, but store different versions, and the markups we see as the edit review are the result of comparison between two versions.

But, how we can compare two texts to highlight the changes?

I wish to code it in PHP.

È stato utile?

Soluzione

To highlight Codechanges you can use some Diff-Tools/Functions.

Short googling found for PHP php-diff. There are also other tools/frameworks for other languages available on internet.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top