我尝试打印json response
但""
被添加到我的json response
我尝试了下面的代码php
并由id
drupal field
<?php
$data = array("title"=>"test","body"=>"test body");
$php = json_encode($data,JSON_FORCE_OBJECT);
echo json_encode(array("php"=>$php,"id"=>10));
?>
输出 :
{"php":"{\"title\":\"test\",\"body\":\"test body\"}","id":10}
但我想要如下输出
{"php":{"title":"test","body":"test body"},"id":10}
我为上述问题添加了更多代码
{"php":"{\"title\":\"test\",\"body\":\"test body\"}","id":10}
为什么不json_encode
从echo json_encode($php);
我如何才能第二次获得高于输出