hi guys, how can i get the difference between two strings in PHP?
i mean lets say string 1 = "hello world"
and string 2 = "Hello World"
the php code should compare these two strings and output something like:
the difference between the two strings is 20%...

so how can i do this???

Recommended Answers

All 2 Replies

Member Avatar

PHP has a number of functions - as shown by Pritaeas' link, but you need to set rules for the comparison, as it can get quite complicated. Case sensitive - OK. How would you do the following:

"Hello World Says Me" | "I Said Hello My World Hello"

What sort of %age would you return for this with your rules?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.