Create an Is.Gd URL Using PHP

By  on  

Is.Gd is a URL-shortening service much like TinyURL. Using PHP's cURL library, you can create shortened URLs on the fly with ease.


//gets the data from a URL  
function get_isgd_url($url)  
	//get content
	$ch = curl_init();  
	$timeout = 5;  
	$content = curl_exec($ch);  
	//return the data
	return $content;  

$new_url = get_isgd_url('');

"" is much shorter than "" so if you need the URL to be as short as possible, use this method.

Recent Features

  • By
    fetch API

    One of the worst kept secrets about AJAX on the web is that the underlying API for it, XMLHttpRequest, wasn't really made for what we've been using it for.  We've done well to create elegant APIs around XHR but we know we can do better.  Our effort to...

  • By
    CSS Animations Between Media Queries

    CSS animations are right up there with sliced bread. CSS animations are efficient because they can be hardware accelerated, they require no JavaScript overhead, and they are composed of very little CSS code. Quite often we add CSS transforms to elements via CSS during...

Incredible Demos

  • By
    dwProgressBar v2:  Stepping and Events

    dwProgressBar was a huge hit when it debuted. For those of you who didn't catch my first post, dwProgressBar is a MooTools 1.2-based progress bar which allows for as much flexibility as possible. Every piece of dwProgressBar can be controlled by CSS...

  • By
    Create a Dojo Lightbox with dojox.image.Lightbox

    One of the reasons I love the Dojo Toolkit is that it seems to have everything.  No scouring for a plugin from this site and then another plugin from that site to build my application.  Buried within the expansive dojox namespace of Dojo is


  1. Ah, I’m glad you did this. is my URL ‘shortener’ of choice. :)

    I’m looking forward to the re-design too BTW!

  2. ‘’ has an API! :-)

    This URL will return just the shortened URL: (no confirmation message)

  3. Thanks for the tip guys. I’ve adjusted my article accordingly.

  4. hanoi

    Hi, How do you highlight PHP syntax in the example above?

    Could you show me a list of WordPress plugins you are using on this blog?



Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!