Код: Выделить всё
$file = {"0": ["finalRate54000"],"1": ["finalRate20000"],"2": ["finalRate1000"]}
Код: Выделить всё
{
"3": [
"finalRate54000"
],
"19": [
"finalRate20000"
],
"21": [
"finalRate1000"
]
Код: Выделить всё
foreach ($file as $kei => $value) {
$result[] = $value;
}
foreach (Session::get('cartGrouped') as $key => $cartItem){
foreach ($result as $i => $data) {
$response[$i] = $data;
array_push($shipper, $response[$i]);
$seller_products[\App\Product::find($cartItem['id'])->user_id] = $response[$i];
}
}
return $seller_products;
Код: Выделить всё
{
"3": [
"finalRate1000"
],
"19": [
"finalRate1000"
],
"21": [
"finalRate1000"
]
Подробнее здесь: https://stackoverflow.com/questions/631 ... -new-array
Мобильная версия