I've been wanting to get a backlink script working for Geeklog for a while, seems like they've become quite popular in weblog circles. There is a Perl version that many people seem to be using, so I took a crack at converting it to PHP but it's a bit longwinded. Naturally PHP has many built-in functions that make this kind of thing a lot easier than Perl ;-)
To view an example of the referrer PHP Block check out http://www.phpkitchen.com/ , it's on the left side under the Amazon block. The source code is available here. I started off Charles F. Johnson's code from http://littlegreenfootballs.com which really is very good then modified it to display unique referrers.
Full install instruction are here;
By the way, we're also running the PHPkitchen Awards, pop by and vote for your favour PHP software.