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