private static function convert($string, $from, $to) {

        if(true === function_exists('iconv')) {
            $result = iconv($from, $to, $string);
        } 
        elseif(true === function_exists('mb_convert_encoding')) {
            $result = mb_convert_encoding($string, $to, $from);
        }
        else {
			return trigger_error(sprintf('%s requires either the iconv or mbstring extension to be installed', __METHOD__), E_USER_ERROR);
        }

        if($result === false) {
            return '';
        }

        return $result;
    }
private static function convert($string, $from, $to) {

        if(true === function_exists('iconv')) {
            $result = iconv($from, $to, $string);
        } 
        elseif(true === function_exists('mb_convert_encoding')) {
            $result = mb_convert_encoding($string, $to, $from);
        }
        else {
			return trigger_error(sprintf('%s requires either the iconv or mbstring extension to be installed', __METHOD__), E_USER_ERROR);
        }

        if($result === false) {
            return '';
        }

        return $result;
    }
private static function convert ( $ string , $ from , $ to ) { if ( true === function_exists ( 'iconv' ) ) { $ result = iconv ( $ from , $ to , $ string ) ; } elseif ( true === function_exists ( 'mb_convert_encoding' ) ) { $ result = mb_convert_encoding ( $ string , $ to , $ from ) ; } else { return trigger_error ( sprintf ( '%s requires either the iconv or mbstring extension to be installed' , __METHOD__ ) , E_USER_ERROR ) ; } if ( $ result === false ) { return '' ; } return $ result ; }
Converts string from encoding to another encoding
@param string $string
@param array|string $from
@param string $to
@return string
Converts string from encoding to another encoding