Question and answer is powered by AnsPress.io
In codeigniter I am trying to return some array value using json_encode(). But it so me some error in my web console when I will try some other languages. I can I fixed these error.
My code:
<?php header("Content-type:application/json"); echo json_encode($data); ?>
For other languages you need to use JSON_UNESCAPED_UNICODE in the json_encode().
For example:
<?php header("Content-type:application/json"); echo json_encode($data, JSON_UNESCAPED_UNICODE); ?>