CodeIgniter Forums

Full Version: Response setJSON problem php tag before.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Response setJSON problem.

current code;
$jsonResult = [
'status' => true
return $this->response->setJSON($jsonResult);

page result;
   "success": true,

<?php added php tag problem.

response headers;
cache-control: no-store, no-cache, must-revalidate
cache-control: no-store, max-age=0, no-cache
cf-ray: 4763af155f6e9c65-AMS
content-encoding: br
content-type: application/json; charset=UTF-8
date: Wed, 07 Nov 2018 23:47:16 GMT
expect-ct: max-age=604800, report-uri=""
expires: Thu, 19 Nov 1981 08:52:00 GMT
last-modified: Wed, 07 Nov 2018 23:47:15 GMT
pragma: no-cache
server: cloudflare
status: 200
vary: Accept-Encoding
x-powered-by: PHP/7.1.23

response body;
   "success": true,
   "error": false,
   "message": null,
   "results": {
       "bkeys": [],
       "ikeys": {
           "841": "1587944",
           "842": "1587690",.....
Problem resolved;
another loaded helper.
PHP Code:
<?php tag
php tag not closed.