function FilterString($str)
{
$aftertrim=trim($str);
$afterstrip= strip_tags($aftertrim);
$agintrim=trim($afterstrip);
$afterremovesapce=strtolower(str_replace(" ","_",$agintrim));
$removeSpecialChar = preg_replace('/[0-9\@\.\;\" "\?]+/', '', $afterremovesapce);
//$strlen=strlen($removeSpecialChar);
if(strlen($removeSpecialChar) > 23)
{
$checklast= substr($removeSpecialChar,0,24);
}
//$afterGarbageremove=gc_disable($checklast);
$agintrim=trim($checklast);
//$lastchar=$checklast[1];
$lastchar= substr($agintrim, strlen($agintrim)-1);
if($lastchar== '_')
{
$isexistlen=strlen($checklast);
$finalstring=substr($checklast,0,$isexistlen-1 );
$returnString= $finalstring;
}else
{
$returnString= $agintrim;
}
return $returnString;
}
No comments:
Post a Comment