[PHP] TinyURL Function

by 1 replies
2
[PHP] TinyURL Function

Quick 2minute mock up of a function that lets you convert long ugly url's into sexy small url's. You could prob integrate this into a project or program etc.

Code:
<?php
/*
File    : tinyurl.php
Author  : Vick Kumar
Date    : 27/09/2011
Vers    : 1.0
contact : vickkumar2011@gmail.com
*/

function tinyurl($url)
{
$keepitsimplestupid = file_get_contents('http://tinyurl.com/api-create.php?url='.$url);
return $keepitsimplestupid;
}

echo tinyurl("http://www.warriorforum.com/programming-talk/");

?>
#programming #function #php #tinyurl
  • I love it when sites like TinyURL have such a simple API. Makes doing things like this a breeze.

Next Topics on Trending Feed

  • 2

    [PHP] TinyURL Function Quick 2minute mock up of a function that lets you convert long ugly url's into sexy small url's. You could prob integrate this into a project or program etc.