This is not like other question. I tried all other way. but still not working. It works locally, but error occurs when uploaded live.
<?php
header('content-type: application/json');
include('lib/functions.php');
if($_SERVER['REQUEST_METHOD']=="GET")
{
$json = get_localtion_list();
echo json_encode($json);
}
What I tried:
ob_start() and ob_end_flush();
Then
changed header like this:
header('content-type: application/json;charset=utf-8');
I think the error happens only on php 7
I placed header first. But that doesn't work
Warning: Cannot modify header information - headers already sent by.../index.php on line 2