Welcome Guest, Not a member yet? Register   Sign In
Response setJSON problem php tag before.
#1
Exclamation 
(This post was last modified: 11-07-2018, 04:53 PM by byazrail.)

Response setJSON problem.

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

page result;
<?php{
   "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="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
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;
<?php{
   "success": true,
   "error": false,
   "message": null,
   "results": {
       "bkeys": [],
       "ikeys": {
           "841": "1587944",
           "842": "1587690",.....
Built on CodeIgniter Framework All Projects
Thanks CI Love You Heart
Reply
#2

Problem resolved;
another loaded helper.
PHP Code:
<?php tag
php tag not closed.
Built on CodeIgniter Framework All Projects
Thanks CI Love You Heart
Reply




Theme © iAndrew 2016 - Forum software by © MyBB