Compare php texts

Asked

Viewed 766 times

1

I need to develop/use a function to compare the text in two versions, to check what has been removed/added/maintained.

One version I upload an html file and extract the plain text, and the other version I get from my database, and also extract the plain text, for comparison.

Do you know of any such function to be used from github or any other source?

I have tried to use the function of this site http://code.iamkate.com/php/diff-implementation/ but they compare row by row, which is not functional, because in version 2, it is possible that a paragraph has been added, and if you compare row by row individually, from one addition, all next comparisons will indicate modification, which is not true.

Manually, the best tool I could find was https://www.diffchecker.com/ but they don’t have an api or open source.

Smart to have been clear enough.

Example of the output I want: inserir a descrição da imagem aqui

2 answers

2

  • Thanks for your help. But I found a code on github that was perfect.

0


  • It is amazing how there are people who do not like to help the community, I left here the answer with the function found to solve such problem and negative people without leaving explanation to improve the content.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.