- 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
- 40
$GLOBALS['_utf8win1251'] = array(
"\xD0\x90"=>"\xC0","\xD0\x91"=>"\xC1","\xD0\x92"=>"\xC2","\xD0\x93"=>"\xC3","\xD0\x94"=>"\xC4",
............
"\xD1\x96"=>"\xB3","\xD1\x97"=>"\xBF","\xD1\x94"=>"\xBA","\xD1\x9E"=>"\xA2");
$GLOBALS['_win1251utf8'] = array(
"\xC0"=>"\xD0\x90","\xC1"=>"\xD0\x91","\xC2"=>"\xD0\x92","\xC3"=>"\xD0\x93","\xC4"=>"\xD0\x94",
............
"\xB3"=>"\xD1\x96","\xBF"=>"\xD1\x97","\xBA"=>"\xD1\x94","\xA2"=>"\xD1\x9E");
function utf8_win1251($a) {
// global $_utf8win1251;
if (is_array($a)){
foreach ($a as $k => $v) {
if (is_array($v)) {
$a[$k] = utf8_win1251($v);
} else {
$a[$k] = strtr($v, $GLOBALS['_utf8win1251']);
}
}
return $a;
} else {
return strtr($a, $GLOBALS['_utf8win1251']);
}
}
function win1251_utf8($a) {
// global $_win1251utf8;
if (is_array($a)){
foreach ($a as $k=>$v) {
if (is_array($v)) {
$a[$k] = win1251_utf8($v);
} else {
$a[$k] = strtr($v, $GLOBALS['_win1251utf8']);
}
}
return $a;
} else {
return strtr($a, $GLOBALS['_win1251utf8']);
}
}
а сколько всего...
mb_convert_encoding и array_walk_recursive отменили...
ну или хотя-бы от вложенных if избавиться можно
paranoid 27.11.2009 19:02 # 0
guest 01.12.2009 19:40 # 0
guest 28.12.2009 00:36 # 0
guest 28.12.2009 00:37 # 0
адрес: http://mpak.su