Last year I needed this functionality in a Zend Framework project so I wrote some code to do this using Zend_Http_Client.

Check it out: http://www.jeremyglover.com/blog/2010/08/26/shorten-urls-with-zend-framework-and-bit-ly/