- Forums
- Snippets
- Clean Image File Name Function Written In Php To Remove Special Characters
This Page Contains information about Clean Image File Name Function Written In Php To Remove Special Characters By wallpaperama in category Snippets with 1 Replies. [1381], Last Updated: Sat May 18, 2024
wallpaperama
Mon Feb 25, 2008
1 Comments
2088 Visits
function clean_image_name($name)
{
$name = strtolower($name);
$code_entities_match = array( '"' ,'!' ,'@' ,'#' ,'$' ,'%' ,'^' ,'&' ,'*' ,'(' ,')' ,'+' ,'{' ,'}' ,'|' ,':' ,'"' ,'<' ,'>' ,'?' ,'[' ,']' ,'' ,';' ,"'" ,',' ,'_' ,'/' ,'*' ,'+' ,'~' ,'`' ,'=' ,' ' ,'---' ,'--','--');
$code_entities_replace = array('' ,'-' ,'-' ,'' ,'' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'-' ,'-' ,'-','-');
$name = str_replace($code_entities_match, $code_entities_replace, $name);
return $name;
}