Calculate text diffs in PHP [duplicate]
it depends exactly what you mean and what you want to do but there is
PEAR Text_Diff - Engine for performing and rendering text diffs
What sort of diffs? File diffs? There is array_diff() which acts on arrays. Then there is also xdiff, which "enables you to create and apply patch files containing differences between different revisions of files.". The latter acts on files or strings.
Edit: I should add xdiff doesn't appear to be out in a release yet. You have to build from source to use it.