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;

1 thought on “Quick short URL PHP function

Leave a Reply

Your email address will not be published. Required fields are marked *

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