Comparing must work on-the-fly, so this must be done via javascript or with php (will make javascript ajax request).
What I need is probably advanced difference showing, so it will be probably best if there is any kind of good supported library.
This picture shows exactly what I need >
Added #1: I found this http://ejohn.org/projects/javascript-diff-algorithm/ (example http://www.djsipe.com/js-diff/) which is ok, but doesn't support multiline? and it changes the whole word when only one character is different...
Added #2: I tested php script ( https://github.com/paulgb/simplediff/ ) but it has flaws.
Added #3: I found what i was looking for ( http://code.google.com/p/google-diff-match-patch/ )