I have an array like
"id": "948",
"app_id": "172",
"image": "75733F51448032347-img.png",
"type": "phone",
"created_at": "2015-11-21 02:12:27",
"updated_at": "2015-11-21 02:12:27"
},
{
"id": "950",
"app_id": "172",
"image": "5813pKb1448032353-img.png",
"type": "phone",
"created_at": "2015-11-21 02:12:33",
"updated_at": "2015-11-21 02:12:33"
},
{
"id": "951",
"app_id": "172",
"image": "6864qUU1448032355-img.png",
"type": "phone",
"created_at": "2015-11-21 02:12:35",
"updated_at": "2015-11-21 02:12:35"
}
I want to change all item image value. I am using this code but not work correctly
foreach($icon as $key => $value)
{
$icon[2] = asset('uploads/apk-screen/'.$value);
unset($icon[2]);
}
Please help me to find out what’s wrong I am doing.
json_decode()to create$iconfirst?