News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Hasin Hayder's Blog:
expanding short url to original url using PHP and CURL
May 06, 2009 @ 12:59:51

Hasin Hayder has a quick post about taking a URL in the opposite direction than most seem to go these days - from shortened to the long, full URL.

Now when you get the short url shortened by using any of these services, you dont know where your browser is taking you! so if you are interested to figure out the original url hiding behind these short url, you need to have a little knowledge on how these services actually work.

Then the short URL is hit, the HTTP response is in the 300 family and the browser is redirected to the correct location. He uses cURL in PHP to grab this header information and parse out the full-length URL to return both the URL requested (the shortened one) and the full-length it was generated to point to.

0 comments voice your opinion now!
shorten expand url service curl tutorial http header 300


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Logging with PSR-3 to Improve Reusability

Rob Allen: Setting up Zend Server 6 on OS X for PHP development

NETTUTS.com: Create a Twitter-Like "Load More" Widget

Carson McDonald's Blog: Building HipHop PHP for Fedora 12 on 64 bit and 32 bit Systems

Gonzalo Ayuso: Working with jQuery and Silex as RestFull Resource provider


Community Events











Don't see your event here?
Let us know!


introduction composer component symfony2 package performance unittest framework release security hhvm facebook install application project podcast hack database language example

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework