I have two strings like this:
$str1 = "this is
a text";
$str2 = "this is a text
which is edited";
As you see there is two difference between them, removed that <br>
which is after is
(in the $str1
) and appending whic is edited
. Now I need to detect those difference, How can I do that?
Actually I need to show to my website's users what's edited. Something exactly like stackoverflow edit page (which highlights the difference with red and green colors).