<?php $response = json_encode([ "success" => true, "quoteId" => 11, "abcValue" => 0, "priceResponse" => [ [ "priceId" => 1263, "fPrice" => 37.14, "grossPrice" => 44.7, "priceType" => "ABC", ], [ "priceId" => 1263, "fPrice" => 37.14, "grossPrice" => 44.7, "priceType" => "ABC", ], [ "priceId" => 1266, "fPrice" => 550.14, "grossPrice" => 544.7, "priceType" => "DEF", ], ], ]); $object = json_decode($response); $object = (object)[ 'success' => $object->success, 'quoteId' => $object->quoteId, 'priceResponse' => array_map( fn($item) => [ 'priceId' => $item->priceId, 'customPrice' => $item->grossPrice * 1.1, ], $object->priceResponse ) ]; print_r($object);
You have javascript disabled. You will not be able to edit any code.