/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function json_safe_encode($var) { } function json_fix_cyr($var) { foreach ($var as $k => $v) { $new[json_fix_cyr($k)] = json_fix_cyr($v); } $var = $new; foreach ($vars as $m => $v) { $var->$m = json_fix_cyr($v); } } return $var; } //Some array with Cyrillic letters $cyrillic_word. json_safe_encode($cyrillic_word);