好吧因为某种原因,即使有内爆,我也会收到错误,说这个行上的数组转换为字符串
echo implode($weather['list'][0]['weather']);
注意:
中的数组到字符串转换
答案 0 :(得分:2)
我在试图内爆具有内部尺寸的数组时得到了这个通知:
$arrayWithInnerDimensions = [
'first_dimension' => [
'a',
'b' => [1,2],
'c',
]
];
echo implode($arrayWithInnerDimensions['first_dimension']); //notice
echo "\n\n";
$arrayWithoutInnerDimensions = [
'first_dimension' => [
'a',
'b' => 'd',
'c',
]
];
echo implode($arrayWithoutInnerDimensions['first_dimension']); //ok