I have a long object stored in an array. I am trying to display an specifics values of this array.
The problem is the following:
foreach($reportVal["OrderEventDetail"] AS $OrderEventDetailK => $OrderEventDetailV){
print_r($reportVal["OrderEventDetail"]);
}
Output:
Array (
[eventId] => 18345
[orderId] => 781
)
Array (
[eventId] => 18345
[orderId] => 781
)
Everything is ok at this point, but:
foreach($reportVal["OrderEventDetail"] AS $OrderEventDetailK => $OrderEventDetailV){
$OrderEventDetailV["orderId"];
}
Output:
1 7
Why its happening? If im printing ["orderId"], the value would be 781 781.
Expected result:
<span class="label label-success" style="background-color: #5cb85c;">Orden <?= $OrderEventDetailV["orderId"] ?></span>
With value:
<span class="label label-success" style="background-color: #5cb85c;">Orden 781</span>