PHP Classes

What is the best PHP class to compare strings?: Compare strings

Recommend this page to a friend!
  All requests RSS feed  >  What is the best PHP class to compare...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

What is the best PHP class to compare strings?

Edit

Picture of Calmette by Calmette - 9 years ago (2015-02-27)

Compare strings

This request is clear and relevant.
This request is not clear or is not relevant.

+6

I want to compare strings and get the differences between them.

Ask clarification

2 Recommendations

PHP Diff Text Strings: Find differences between texts and patch strings

This class can find differences between texts and patch strings.

It can compare two given text strings and return the differences between them.

The class can also patch the original string using an optimized version of the difference information to obtain the second string.
This recommendation solves the problem.
This recommendation does not solve the problem.

+3

Picture of Melanie Wehowski by Melanie Wehowski package author package author Reputation 135 - 9 years ago (2015-03-05) Comment

This class has similar functionality. It does not render the differences for you, but provides an optimized compressed version (to save space) of the differences and also can patch back to the original string from the optimized differences. However, if you need the class to render the differences you should prefer the above class of Manuel Lemos.


PHP Text Diff Highlight class: Find and view the difference between text strings

This class can find and view the difference between text strings.

It takes two text strings and uses the diff algorithm to find the differences between them and return a list of changes to patch the original string to become the final string.

The patch list shows what text should be added or removed to change one string into the other.

The difference between the text strings may be computed in three modes: by character, by word or by line.

The class may also format the strings to view them as HTML showing which characters are added and removed with special insertion and deleted styles.

The example page works as a tool to interactively view the changes as the user changes the texts before and after the changes are applied.

The class can also patch the original string using the patch list to regenerated the changed string.
This recommendation solves the problem.
This recommendation does not solve the problem.

+4

Picture of Manuel Lemos by Manuel Lemos package author package author Reputation 26695 - 9 years ago (2015-03-04) Comment

This class can compare two strings and return the list of changes to turn one string into the other, like lines or characters to add or removed.

It can also present the string changes in HTML so you can view them in a Web page. 


Recommend package
: 
: