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.

Comments

cadmagician

August 30th, 2008 2:27pm
nice.

Sergey

February 24th, 2009 11:59pm
This is amazing work, dude. I search same thing fo a long time. You save my codeless nights =) Great thanks.

christian

July 16th, 2009 10:44pm
Just wanted to drop a note and say thanks. This code works great in my site deployment code. Great work!
.