gpt4 book ai didi

php - 将字段的所有值移动到数组

转载 作者:行者123 更新时间:2023-11-30 22:31:05 24 4
gpt4 key购买 nike

我想将名为 CONTENT_VALUE 的字段的所有值移动到一个数组变量中。现在我发现错误 json_decode() expects parameter 1 to be string, array given

enter image description here

while($fet_pic=mysql_fetch_array($albpic))
{
$album[]=$fet_pic['CONTENT_VALUE'];
$bulk=json_decode($album);
}

最佳答案

只需在json_decode函数中将第二个参数设置为true即可:

//...
$bulk=json_decode($fet_pic['CONTENT_VALUE'], true);
//...

关于php - 将字段的所有值移动到数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33893568/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com