RsD0p9BK
1/26/2018 - 10:21 AM

How to json_encode array with cyrilic accents?

How to json_encode array with cyrilic accents?

// преобразование utf8 в cp1251
$current_charset = 'windows-1251';
array_walk_recursive($m_post, function(&$value) use ($current_charset) {
  $value = iconv($current_charset, 'UTF-8', $value);
});

$str_post = array('str_post' => json_encode($m_post));

https://stackoverflow.com/a/6929069/2618535