我希望能够删除我的 json_encode 中的双引号:
$response = array(
"response" => true,
"ack_move" => array(
"slot" => $move,
"isWin" => false,
"isDraw" => false,
"row" => array()
);
echo json_encode($response);
我的结果是:
{"response":true,"ack_move":{"slot":"3","isWin":false,"isDraw":false,"row":[]}
我想删除整数“3”的双引号
我该怎么做,结果是:
{"response":true,"ack_move":{"slot":3,"isWin":false,"isDraw":false,"row":[]}
您可以尝试使用函数 intval($move) 获取整数值,然后分配该值。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句