A bit like this from WordPress: 
Or this from MediaWiki: 
I have tried several diff engines in PHP, the most comprehensive seem to be (http://www.raymondhill.net/finediff/viewdiff-ex.php) and PEAR’s Text_Diff, but I can’t seem to find any option to have both versions stacked side by side like in the above images. I think that is easier to read than having both version in one.
Have found a solution – by taking the WP_Text_Diff_Renderer_Table class from WordPress (wp-includes/wp-diff.php) which is used in conjuction with PEAR Text_Diff:
When wrapped in tags the above code produces the same HTML layout as the above WordPress screenshot. There are then four CSS rules to style:
paragraph/line that is changed from
the source text
that is changed in the destination
text
from the source
changed in the destination
More details here: http://www.webdevguides.co.uk/php-2/wordpress-style-diff-in-php