Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sudheer Satyanarayana  >  URL Shorten using short.ie  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example usage of class
Class: URL Shorten using short.ie
Create and retrieve short URLs using short.ie
Author: By
Last change:
Date: 2009-07-17 08:42
Size: 878 bytes
 

Contents

Class file image Download
<?php
/**
 * This is an example script explaining how to use ShortIe.class.php
 *
 */

/**
 * require the class file
 */
require_once 'ShortIE.class.php';

/**
 * Instantiate the ShortIE object and pass the URL to be shortened to the constructor
 */
$urlShorten = new ShortIe('http://binaryvibes.co.in');

/**
 * Fetch the shortened URL 
 */
$shortened $urlShorten->getShortenedUrl();

/**
 * Print the shortened URL
 */
echo $shortened;
echo 
"\n\n";

/**
 * Alternate way to use the class
 * $urlShorten = new ShortIe();
 * $urlShorten->setUrlToBeShortened($myUrl);
 * echo $urlShorten->getShortenedUrl();
 */

/**
 * For php scripts, PHP, MySQL, Linux, JavaScript and web development articles, blogs and forums go to 
 * http://techchorus.net
 * 
 * To avail commercial PHP development services go to
 * http://binaryvibes.co.in
 */