【发布时间】:2019-09-07 21:43:18
【问题描述】:
我有一个数组
Array (
[username] => abc123456,
[password] => 9876543214,
[json_input] => [{
"AWB_NUMBER":"8518049",
"ORDER_NUMBER":"TF6E9NRC3J51145",
"PINCODE":"110001"
}]
)
我无法从 json_input
获取 PINCODE 的值我已尝试解码 json_input,因为它是 编码
【问题讨论】:
-
WARNING Illegal string offset 'json_input' WARNING Illegal string offset 'PINCODE'
-
您是否已经从解码后的数组中解码了
"json_input"索引? -
为什么它是
String而不是简单的 json 格式? -
@ArnaudClaudel :请检查更新数组。 json_input 是 json_encoded,其余不是 json_encoded
-
更新数组的答案是
json_decode($array['json_input'],true)['PINCODE']
标签: php arrays json multidimensional-array