Posted By

apphp-snippets on 02/18/13


url php shorl

Versions (?)

Get short urls for Twitter with PHP

 / Published in: PHP


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.

  1. <?php
  2. function getShortUrl($url){
  3. return file_get_contents(''.$url);
  4. }
  5. ?>

Report this snippet  

You need to login to post a comment.