Recommend this page to a friend! |
Classes of Ákos Nikházy | Simple PHP String Comparison | README.md | Download |
|
|
![]() simple-string-comparisonLess simple than strcmp. Compare strings letter by letter or bit by bit It returns an int value representing the difference between two strings. For example, it gives a more precise difference between uppercase and lowercase letters, so you can decide if there is a typo between two strings. There are also letter-by-letter and binary comparisons. Use it like this:Letter by letter mode: This will return 1 as one letter is different (in the word fox there is a typo).
Binary mode: This will return 2 because in binary mode the distance between the e and o in the two sentences is 2.
|