Skip to content
Advertisement

Unexpected number showing up at the end of JSON body

I am trying to write a simple demo that reads a json file with php and ajax. In js I have

JavaScript

summary.php

JavaScript

summary.json

JavaScript

When I make a request I get an unusual 706 at the end of the response. curl localhost/summary.php | Select Content -Expand Content | jq produces

JavaScript

Any help with this would be greatly appreciated.

Advertisement

Answer

For your summary.php you actually want it to be more like the following to do what you are intending to do

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement