1

Possible Duplicate:
Highlight the difference between two strings in PHP

I have those strings for example:

example XY2\r\n(system x)

and

something else XY2

As you see, only the XY2 is the same. Whats the best way to check if 2 strings have something in common, like XY2?

Thanks!

Community
  • 1
  • 1
EOB
  • 2,975
  • 17
  • 43
  • 70

1 Answers1

1

you can try using similar_text function. Not quiet what you need but can be helpful.

Look at this post on finding largest common substring.

Community
  • 1
  • 1
Alex
  • 6,441
  • 2
  • 25
  • 26