Location: PHPKode > scripts > Perfect URL Trimmer > perfect-url-trimmer/index.php
<?php
/************************************************
*	========================================	*
*	Perfect URL Trimmer							*
*	========================================	*
*	Script Name: index.php						*
*	Developed By: Khurram Adeeb Noorani			*
*	Email: hide@address.com				*
*	My CV: http://www.visualcv.com/kanoorani	*
*	Twitter: http://www.twitter.com/kanoorani	*
*	Date Created: 05-AUGUST-2009				*
*	Last Modified: 05-AUGUST-2009				*
************************************************/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Perfect URL Trimmer</title>
</head>
<body>
<h1>Perfect URL Trimmer</h1>
<?php
include("class.trimmer.php");
$TRIMMER=new TRIMMER();
/*
Optional parameters are tr.im bit.ly ur.ly for forcefully using a specific URL trimming services
See the comments on line #109 of class.trimmer.php
*/
?>
<h2>Trimming the URLs inside a string</h2>
<?php
$str="The number one search engine is http://www.google.com but people also use www.yahoo.com as their second choice.";
echo $str."<br>";
echo $TRIMMER->trim_string($str);
?>
<h2>Trimming a URL using tr.im</h2>
<?php
$TRIMMER->set_service("tr.im");
$url="http://www.facebook.com";
echo $url."<br>";
echo $TRIMMER->trim_url($url);
?>
<h2>Trimming a URL using bit.ly</h2>
<?php
$TRIMMER->set_service("bit.ly");
$url="http://www.twitter.com";
echo $url."<br>";
echo $TRIMMER->trim_url($url);
?>
<h2>Trimming a URL using ur.ly</h2>
<?php
$TRIMMER->set_service("ur.ly");
$url="http://www.twitterface.com";
echo $url."<br>";
echo $TRIMMER->trim_url($url);
?>
<h2>Trimming a URL that is already trimmed</h2>
<?php
$url="http://bit.ly/164PhJ";
echo $url."<br>";
echo $TRIMMER->trim_url($url);
?>
</body>
</html>
Return current item: Perfect URL Trimmer