Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image upload: renaming issue
#3
Thanks for the reply Shawn!
I thought I need to change to7bit afterwards, this has confused me...Smile

I got it working with this now:
PHP Code:
function clean_img_name($text)  { 
    
$text strip_tags(lowercase($text)); 
    
$code_entities_match = array(' ?',' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','/','*','+','~','`','='); 
    
$code_entities_replace = array('','-','-','','','@','','','','','','','','','','','','','','','','','','','',''); 
    
$text str_replace($code_entities_match$code_entities_replace$text); 
    
$text urlencode($text);
    
$text str_replace('--','-',$text);
    
$text str_replace('%40','@',$text);
    
$text rtrim($text"-");
    return 
$text


Replaced %40 back to @ afterwards. Thanks for the little push Smile
Reply


Messages In This Thread
Image upload: renaming issue - by b3n.ji - 2014-03-05, 22:00:48
RE: Image upload: renaming issue - by shawn_a - 2014-03-06, 01:28:16
RE: Image upload: renaming issue - by b3n.ji - 2014-03-06, 02:02:00
RE: Image upload: renaming issue - by shawn_a - 2014-03-06, 02:26:13
RE: Image upload: renaming issue - by shawn_a - 2014-03-11, 03:00:57
RE: Image upload: renaming issue - by b3n.ji - 2014-03-11, 04:01:34



Users browsing this thread: 2 Guest(s)