Quick short URL PHP function

August 27, 2010
By Bogomil Shopov
1 Comments
Post Image
function shortURL($long)
{
 $short=file_get_contents("http://is.gd/api.php?longurl=".$long);
 return $short;
}

Usage:

$short = shortURL("http://veryveryveryverylongurl.tld/something/verylong.php");
echo $short;

Bogomil Shopov

I care about privacy, ethical design, and freedom in many aspects. I spend 20+ years working as a web developer and architect, analyst, manager, and product owner/manager in different environments, several countries, and multiple software industries like Healthcare and Hospitality. I wore many hats, and I use the knowledge gathered to optimize the flow of value across complex systems.

One Comment

  • Bogo

    December 17, 2010 at 1:04 pm

    I have to fix that :)

    Reply

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.