EchoFool Posted June 17, 2010 Share Posted June 17, 2010 Hey, Say i had two strings assigned to different variables like $var = 'Hello there, how are you ?'; $var2 = 'Hello there, how are you today?'; I want to get a function automatically highlight whats different between the two by - say for example highlighting the added words in a red font. So like the result would show (after comparison) Hello there, how are you today? Is there a built in function for such a thing or is this a make your own function moment? Quote Link to comment Share on other sites More sharing options...
gizmola Posted June 17, 2010 Share Posted June 17, 2010 This is called a "diff". There's no php built-in, but there is a PEAR package named text_diff as well as other packages based on it, you can find out there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.