我有一个PHP数组,如下所示:
[0] => Array
(
[label] => Standard Stop
[code] => 5
[excludeIF] => [miniTrack, isTriangleHanger, tubeTrack, boxTrack]
)
[1] => Array
(
[label] => Soft Stop With Lag
[code] => 7
[excludeIF] => [miniTrack, isTriangleHanger, tubeTrack, boxTrack]
)
当我执行json_encode时,会生成如下内容:
{"label":"Standard Stop","code":"5","excludeIF":"[miniTrack, isTriangleHanger, tubeTrack, boxTrack]"}
该编码的问题在于它使code
成为一个字符串,它也使excludeIF
成为一个字符串。
code
需要成为一个浮动
excludeIF
需要是一个数组
使用JSON Encode可以实现这样吗?