Skip to content

Instantly share code, notes, and snippets.

@cbuchler
Created April 24, 2013 14:11
Show Gist options
  • Save cbuchler/5452411 to your computer and use it in GitHub Desktop.
Save cbuchler/5452411 to your computer and use it in GitHub Desktop.
How to get short urls.
<?php
function getShrtUrl($url){
return file_get_contents('http://tinyurl.com/api-create.php?url='.$url);
}
# Example
echo getShrtUrl('http://www.google.com');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment