Roshan Book

My Tech Notebook

Tag Archives: USing tinyurl api to generate short link

Creating a TinyURL with TinyURL’s API

Function

<?php
function createTinyUrl($strURL) {
    $tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$strURL);
    return $tinyurl;
}
?>
 
To call this function
Advertisements
%d bloggers like this: