It is currently Wed May 22, 2013 7:12 pm

All times are UTC


You can access below Applications



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: creating seo-friendly urls
PostPosted: Tue May 25, 2010 8:09 am 
Offline

Joined: Wed Mar 17, 2010 4:58 am
Posts: 69
Location: Neyveli
Hi friends,

here is function for producing SEO friendly urls in php

Code:
<?php
$Raw="http://The Americans of Manvico:!^$#@~ dolls and American Families
";
$seo_url=CleanFileName( $Raw )
echo $seo_url;
//for creating seo-friendly urls.
function CleanFileName( $Raw ){
    $Raw = trim($Raw);
    $RemoveChars  = array( "([\40])" , "([^a-zA-Z0-9-])", "(-{2,})" );
    $ReplaceWith = array("-", "", "-");
    $cleanedurl=preg_replace($RemoveChars, $ReplaceWith, $Raw);
   if (strlen($cleanedurl)>55)
   {
   $cleanedurl=substr($cleanedurl,0,55);
   }
   return $cleanedurl;
}
?>


Regards,
vetriselvi k
Share |


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron