Remove some Regular expression or extra keyword or space PHP
public function clean_url($text)
{
$text=strtolower($text);
$code_entities_match = array('
','--','"','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','"','<','>',
'?','[',']','\\',';',"'",',','.','/','*','+','~','`','=');
$code_entities_replace =
array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');
$text = str_replace($code_entities_match, $code_entities_replace, $text);
return $text;
}
No comments:
Post a Comment