Below is the starting of json that I've received in $json variable.
{"page":"0","cartaddonpopover":{"refreshfeature":1,"featurehtml":""},"initiateid":null,"containsmapitem":0,"wishlist":{"refreshfeature":1,"featurehtml":"\n<div id=\"cart-wishlist\" style=\"display:none;\" class=\"cart-wish-list\" >\n</div>\n\n"},"gutter":{"refreshfeature":1,"featurehtml":"\n\n\n\n\n\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div id=\"cart-gutter\" class=cart-gutter quantity=\"151\">\n\n
I want to extract the value of quantity
, which is 151
in above case.
I'm currently using, $quantity = $json->featurehtml->{"cart-gutter"}->quantity;
and I know that I'm wrong. Please guide.