json_encode 사용 시 한글이 깨져서 나오는 경우가 있다 아래와 같이 대응해주면 된다. * PHP 5.4 이상 버전 - JSON_UNESCAPED_UNICODE 옵션사용 . json_encode($str, JSON_UNESCAPED_UNICODE) * PHP 5.4 이하 버전 - 아래 함수 사용 function json_encode2($arr){ array_walk_recursive($arr, function (&$item, $key) { if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); }); return mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); }...
#
json_encode
#
한글깨짐
원문 링크 : json_encode 한글깨짐