public static function deaccent($string,$case=0)
    {
        if($case <= 0){
            //global $utf8_lower_accents;
            $string = str_replace(array_keys(self::$utf8_lower_accents),array_values(self::$utf8_lower_accents),$string);
        }
        if($case >= 0){
            //global $utf8_upper_accents;
            $string = str_replace(array_keys(self::$utf8_upper_accents),array_values(self::$utf8_upper_accents),$string);
        }
        return $string;
    }
public static function deaccent($string,$case=0)
    {
        if($case <= 0){
            //global $utf8_lower_accents;
            $string = str_replace(array_keys(self::$utf8_lower_accents),array_values(self::$utf8_lower_accents),$string);
        }
        if($case >= 0){
            //global $utf8_upper_accents;
            $string = str_replace(array_keys(self::$utf8_upper_accents),array_values(self::$utf8_upper_accents),$string);
        }
        return $string;
    }
public static function deaccent ( $ string , $ case = 0 ) { if ( $ case <= 0 ) { //global $utf8_lower_accents; $ string = str_replace ( array_keys ( self :: $ utf8_lower_accents ) , array_values ( self :: $ utf8_lower_accents ) , $ string ) ; } if ( $ case >= 0 ) { //global $utf8_upper_accents; $ string = str_replace ( array_keys ( self :: $ utf8_upper_accents ) , array_values ( self :: $ utf8_upper_accents ) , $ string ) ; } return $ string ; }
Replace accented UTF-8 characters by unaccented ASCII-7 equivalents

Use the optional parameter to just deaccent lower ($case = -1) or upper ($case = 1)
letters. Default is to deaccent both cases ($case = 0)

@author Andreas Gohr <andi@splitbrain.org>
Replace accented UTF - 8 characters by unaccented ASCII - 7 equivalents