Created
April 24, 2013 14:11
-
-
Save cbuchler/5452411 to your computer and use it in GitHub Desktop.
How to get short urls.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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