【发布时间】:2021-03-11 13:52:11
【问题描述】:
如何将 JSON 数组字符串转换为数组 示例 - 这是数组 json 字符串 -
$params = [{"143":"166"},{"93":"49"}];
使用 json_decode 时
$options1 = json_decode($params, true);
但它会返回
[super_attribute1] => Array
(
[0] => Array
(
[143] => 166
)
[1] => Array
(
[93] => 49
)
)
但我需要我们如何转换成这种格式?
super_attribute] => Array
(
[143] => 163
[93] => 49
)
【问题讨论】:
-
您展示的示例与您得到的结果不符。
-
super_attribute] => Array看起来不是一个有效的结果 - 请分享更多详细信息
标签: php arrays indexing associative-array