PHP Classes

File: examples/shorten-urls.php

Recommend this page to a friend!
  Classes of Igor Escobar   Bitly-PHP   examples/shorten-urls.php   Download  
File: examples/shorten-urls.php
Role: Example script
Content type: text/plain
Description: How to shorten an url with Bitly-PHP
Class: Bitly-PHP
Expand or shorten URLs using the bit.ly site
Author: By
Last change: - New simple way to shorten urls
Date: 14 years ago
Size: 193 bytes
 

Contents

Class file image Download
<?php

   
include_once("../bitly.php");
   
   
$bitly = new Bitly('<your_login>','<api_key>');
    echo
$bitly->shorten('http://www.google.com/');
       
// echo will output the shorten url

?>