I am trying to fetch an external JSON response with my PHP back-end But my problem is that the external endpoint is returned as the Content-Type: text/plain;charset=utf-8, and that only gives me gibberish when I read it.
string '����������ݒ�J�� ... etc...
Is there a way to encode that response?
This is what I have done:
$response = file_get_contents('external_url');
I have also tried this:
$json = json_decode(file_get_contents('external_url'), true);
header('Content-Type: text/html; charset=UTF-8');