There's a PEAR package that does that too ( http://pear.php.net/package/Services_ShortURL/ ) better again it works with other shortener services as well as bitly. Admittedly the documentation needs a bit of work!