PHP
echo json_encode 배열로 보내주는거랑 객체로 보내주는것 차이
sj0020
2021. 11. 25. 17:20
retVal은 원래 배열임
Array ( [0] => Array ( [0] => 2021-11-25 [1] => 2021-11-24 [2] => 2021-11-23 [3] => 2021-11-22 [4] => 2021-11-21 [5] => 2021-11-20 [6] => 2021-11-19 ) [1] => Array ( [0] => 5.32 [1] => 7.76 [2] => 5.69 [3] => 3.66 [4] => 6.67 [5] => 8.23 [6] => 6.21 )
echo json_encode($retVal);
로 했을 때 console.log 에 찍은것
---
echo json_encode(array("retVal"=>$retVal),JSON_UNESCAPED_UNICODE);
로 했을 때 console.log 에 찍은것
