i have multidimensional arrays generated by PHP with data from database ,but i have chars like \"č ć š đ ž\" and when i try to output that in json he just returns null , i d
Try this function:
function utf8_converter($array) { array_walk_recursive($array, function(&$item, $key){ if(!mb_detect_encoding($item, 'utf-8', true)){ $item = utf8_encode($item); } }); return $array; }