PHP File Diff

August 9th, 2008
So for anybody that has ever used Trac to look at your SVN repo's you'll know that there is a cool diff tool they use that shows the differences between change sets.

The tool shows the additions / deletions of the code highlighted in different colours with line numbers and some clever shizzle.

So anyway, I thought that was pretty cool so decided to have a go at it in PHP. You can see my attempt over here and the code for that page is available here.

It's a pretty simple class which compares and highlights all the differences between 2 files or strings located on your server. I was going to do loads of cool stuff with this but never got round to it. Hopefully his will be a helpful start to someone else.

Tags: PHP   Code   file diff   compare   contents   difference  

Comments

cadmagician

August 30th, 2008 2:27pm
nice.

Leave a reply:

(required)
(Will not be displayed) (required)
.
© Ross Scrivener 2008 | Contact