| @@ 1973-1980 (lines=8) @@ | ||
| 1970 | */ |
|
| 1971 | public static function to_utf8($string) |
|
| 1972 | { |
|
| 1973 | if (is_array($string)) { |
|
| 1974 | foreach ($string as $k => $v) { |
|
| 1975 | /** @noinspection AlterInForeachInspection */ |
|
| 1976 | $string[$k] = self::to_utf8($v); |
|
| 1977 | } |
|
| 1978 | ||
| 1979 | return $string; |
|
| 1980 | } |
|
| 1981 | ||
| 1982 | $string = (string)$string; |
|
| 1983 | ||
| @@ 4210-4218 (lines=9) @@ | ||
| 4207 | */ |
|
| 4208 | public static function fix_utf8($string) |
|
| 4209 | { |
|
| 4210 | if (is_array($string)) { |
|
| 4211 | ||
| 4212 | foreach ($string as $k => $v) { |
|
| 4213 | /** @noinspection AlterInForeachInspection */ |
|
| 4214 | $string[$k] = self::fix_utf8($v); |
|
| 4215 | } |
|
| 4216 | ||
| 4217 | return $string; |
|
| 4218 | } |
|
| 4219 | ||
| 4220 | $last = ''; |
|
| 4221 | while ($last <> $string) { |
|