<?php
$shipmentDet = '{"{\"Coupon\": \"\", \"PromotionName\": \"FREE Tighty Wifey\", \"DiscountAmount\": 23.75}","{\"Coupon\": \"get20\", \"PromotionName\": \"GET20\", \"DiscountAmount\": 20}"}';
$newString = str_replace('","', '"},~;{"', $shipmentDet);
$explore = explode(',~;', $newString);
$decode = substr($explore[0], 1, -1);
print_r($decode);
//print_r($explore);
foreach ($explore as $cpnItm) {
$json_decoder = (array)json_decode($decode,true);
//print_r($json_decoder[0]);
// print_r($json_decoder[0]['PromotionName']);
}
preferences:
53.71 ms | 402 KiB | 5 Q