TinyURL API的PHP函數如下
<?PHP
function TinyURL($u){
return file_get_contents('http://tinyurl.com/api-create.PHP?url='.$u);
}
?>
調用的例子是
<?PHP
$url = 'http://www.jzxue.com/';
$tiny = TinyURL($url);
echo('The TinyURL of "'.$url.'" is "'.$tiny.'"');
dIE();
?>