Clean Image File Name Function In Php
Posted On Mon Feb 25, 2008 By hostman In Snippets forums topics about simple codes to make programming fun Forums
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;
}
some Sun Mar 29, 2009
bad. does not take account for every symbol and unicode. should be done with a regex
Related Content
Information
Forums »
Snippets forums topics about simple codes to make programming fun »
Clean Image File Name Function In Php
Snippets forums topics about simple codes to make programming fun »
Clean Image File Name Function In Php
Title: Clean Image File Name Function In Php
Description: Clean Image File Name Function In Php
Tags: clean ,image ,file ,name ,function ,in ,php
Info: This Post Has Been Viewed 0 Times Since
Date: Mon Feb 25, 2008
Author hostman Received 1 Replies #1381
Date: Mon Feb 25, 2008
Author hostman Received 1 Replies #1381
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5