Greetings, I come to you because I cannot go through an associative array, the array is as follows:
"items": [
{
"id": "2050144",
"quantity": 1,
"name": "Split Mabe MMT12CDBWLCCE8 12.000 BTU - Color Blanco 100058314",
"refId": "100058314",
"price": 40232,
"listPrice": 67054,
"tax": 4827,
"bodega": 397
},
{
"id": "2004254",
"quantity": 1,
"name": "Refrigeradora Electrolux ERT44K6CMG 440 Litros - Color Gris 100046374",
"refId": "100046374",
"price": 48794,
"listPrice": 111161,
"tax": 5855,
"bodega": 397
}
]
I run it like this:
foreach (items as $itemp) :
$r=$itemp->refId;
if ($itemp->refId == 100058314) {
$r="siiii";
}
endforeach;
What I need to do is change the value of the warehouse when the refId field is the same as the one I sent, but I cannot go through the array. I would greatly appreciate your help
It's a JSON, right? In that case you have to do like this: