- 01
 - 02
 - 03
 - 04
 - 05
 - 06
 - 07
 - 08
 - 09
 - 10
 - 11
 - 12
 - 13
 - 14
 - 15
 - 16
 - 17
 - 18
 - 19
 - 20
 - 21
 - 22
 - 23
 - 24
 - 25
 - 26
 - 27
 - 28
 - 29
 - 30
 - 31
 - 32
 - 33
 - 34
 - 35
 - 36
 - 37
 - 38
 - 39
 
                        private function cp1251_utf8($sInput) {
                $sOutput = "";
                for ( $i = 0; $i < strlen( $sInput ); $i++ )
                {
                        $iAscii = ord( $sInput[$i] );
                        if ( $iAscii >= 192 && $iAscii <= 255 )
                                $sOutput .=  "&#".( 1040 + ( $iAscii - 192 ) ).";";
                        else if ( $iAscii == 168 )
                                $sOutput .= "&#".( 1025 ).";";
                        else if ( $iAscii == 184 )
                                $sOutput .= "&#".( 1105 ).";";
                        else
                                $sOutput .= $sInput[$i];
                }
                return $sOutput;
        }
        protected function utf8_strtr($str, $from, $to = '') {
                $str = iconv('UTF-8', 'cp1251', $str);
                $str = $to ? strtr($str, $from, $to) : strtr($str, $from);
                return iconv('cp1251', 'UTF-8', $str);
        }
        public function date_rus($str) {
                $str = str_replace('Jan', 'Янв', $str);
                $str = str_replace('Feb', 'Фев', $str);
                $str = str_replace('Mar', 'Мар', $str);
                $str = str_replace('Apr', 'Апр', $str);
                $str = str_replace('May', 'Май', $str);
                $str = str_replace('Jun', 'Июн', $str);
                $str = str_replace('Jul', 'Июл', $str);
                $str = str_replace('Aug', 'Авг', $str);
                $str = str_replace('Sep', 'Сен', $str);
                $str = str_replace('Oct', 'Окт', $str);
                $str = str_replace('Nov', 'Ноя', $str);
                $str = str_replace('Dec', 'Дек', $str);
                return $str;
        }
                                 
        
Комментарии (5) RSS
Добавить комментарий