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
I've found iconv to be the best method of converting a character set to UTF-8. You can make use of PHP's array_walk_recursive to work with multidimensional arrays:
$array = array(); // This is your multidimensional array
array_walk_recursive($array, function(&$value, $key) {
if (is_string($value)) {
$value = iconv('windows-1252', 'utf-8', $value);
}
});
You can change windows-1252 to whichever character set you're converting from.