• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Response setJSON problem php tag before.

#1
Exclamation 
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.