<?
$my_url = getTinyUrl('http://www.example.com');
echo 'Short url: '.$my_url;
function getTinyUrl($url) {
return file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
}
?>
OUTPUT:
Short url: http://tinyurl.com/7567
$my_url = getTinyUrl('http://www.example.com');
echo 'Short url: '.$my_url;
function getTinyUrl($url) {
return file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
}
?>
OUTPUT:
Short url: http://tinyurl.com/7567
No comments:
Post a Comment