json_encode 文字化け問題の解決

function _encode($arr)
{
$na = array();
foreach ( $arr as $k => $value ) {
$na[_urlencode($k)] = _urlencode ($value);
}
return addcslashes(urldecode(json_encode($na)),"\\r\\n");
}

function _urlencode($elem)
{
if(is_array($elem)){
foreach($elem as $k=>$v){
$na[_urlencode($k)] = _urlencode($v);
}
return $na;
}
return urlencode($elem);
}

Source

Posted by arkgame