Get Short URLs for Twitter with PHP
If you work with Twitter, you probably use a url shortener such as tinyurl.com or bit.ly 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.
[View All Snippets]
[View All Snippets]
Show Plain Text »
- <?php
- function getShortUrl($url){
- return file_get_contents('http://tinyurl.com/api-create.php?url='.$url);
- }
- ?>