This is a modified version of the code snippet available at: http://hasin.wordpress.com/2009/05/05/expanding-short-urls-to-original-urls-using-php-and-curl/#comment-68180
It’s a php command line tool to expand a provided short url.
1 2 3 4 5 6 7 8 |
<?php echo "\n\nEnter URL:\n>>> "; $url = trim(fgets(STDIN)); echo "\n\n"; $h = get_headers($url,true); // print_r($h); echo "Original URL: {$h['Location']} \n\n"; ?> |
One reply on “PHP-CLI: Expand Short URLs”
[…] one of my last posts, I posted a code snippet which demonstrated how to use php to expand short URLs to their original […]