Darkness Soul Posted July 12, 2006 Share Posted July 12, 2006 Yo,Guys, I need a little help.. or maybe a little function.. I've been seach at php.net function list and don't see nothing like what I need..I need a function to remove and replace special chars.. to make safe names to the images without cripty then..exemple:[code]$image = '#_Àéçomn_01.jpg' ;$image = fun_rem_spec_char ( $image ) ;print $image ;[/code]: _Aecomn_01.jpgThanks for the help..D.Soul Quote Link to comment Share on other sites More sharing options...
effigy Posted July 12, 2006 Share Posted July 12, 2006 Will the incoming character set always be the same? (Do you know it?) Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted July 12, 2006 Author Share Posted July 12, 2006 Nops,This is a "public private" tool.. a lot of users may upload a lot of images..You think about convert the charset? or something like it?D.Soul Quote Link to comment Share on other sites More sharing options...
effigy Posted July 12, 2006 Share Posted July 12, 2006 This is a bit of a challenge because you're trying to [i]visually[/i] (not [i]actually[/i]) convert a character set. To my knowledge there is nothing in PHP to do this because, honestly, you shouldn't. See my signature about Unicode and character sets; here's a quote from it: "There Ain't No Such Thing As Plain Text."Why don't you convert the string to UTF-8 and use it as is? Are you running Unix?For example:[tt]<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><?php $string = '#_Àéçomn_01.jpg'; echo utf8_encode($string);?></body></html>[/tt] Quote Link to comment Share on other sites More sharing options...
effigy Posted October 5, 2006 Share Posted October 5, 2006 I ran across [url=http://us2.php.net/manual/en/function.mb-convert-encoding.php#69412]this[/url]; "some code to convert latin diacritics to their traditional 7bit representation." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.