Return to Snippet

Revision: 62358
at February 18, 2013 21:22 by apphp-snippets

Initial Code
function getShortUrl($url){
    return file_get_contents(''.$url);

Initial URL

Initial Description
If you work with Twitter, you probably use a url shortener such as or to share/post your favorite blog posts or important messages with links on the network. This snippet take your url as a parameter and returns a short url.

Initial Title
Get short urls for Twitter with PHP

Initial Tags
url, php

Initial Language