<?php
$array = Array (
'meta' => Array (
'code' => 200 ,
'type' => 'Success',
'message' => 'Success',
) ,
'data' => Array (
'items' => Array (
'0' => Array (
'id' => 'b4a235596fd9550dfb69f181f4db007f',
'tracking_number' => 2649884668232181,
'carrier_code' => 'hermes',
'order_create_time' =>'' ,
'destination_code' =>'',
'status' => 'delivered' ,
'track_update' =>'' ,
'original_country' =>'' ,
'itemTimeLength' => 7 ,
'stayTimeLength' => 74 ,
'service_code' =>'' ,
'packageStatus' => '',
'substatus' => '',
'last_mile_tracking_supported' => '',
'origin_info' => Array (
'ItemReceived' => '2019-04-09 09:29',
'ItemDispatched' => '',
'DepartfromAirport' => '',
'ArrivalfromAbroad' => '',
'CustomsClearance' => '',
'DestinationArrived' => '',
'weblink' => 'https://www.hermesworld.com/en/' ,
'phone' => '',
'carrier_code' => 'hermes' ,
'trackinfo' => Array (
'0' => Array (
'Date' => '2019-04-15 11:51' ,
'StatusDescription' => 'Posted through letterbox' ,
'Details' => '',
'checkpoint_status' => 'delivered '
) ,
'1' => Array (
'Date' => '2019-04-15 09:45',
'StatusDescription' => 'Delivery will be attempted between 10:00 and 14:00 today' ,
'Details' => '',
'checkpoint_status' => 'transit'
) ,
'2' => Array (
'Date' => '2019-04-15 06:39' ,
'StatusDescription' => 'On its way to the courier' ,
'Details' => '',
'checkpoint_status' => 'transit'
) ,
'3' => Array (
'Date' => '2019-04-14 22:33',
'StatusDescription' => 'At the customers local depot' ,
'Details' => '',
'checkpoint_status' => 'transit'
)
)
),
'destination_info' => '',
'lastEvent' => 'Posted through letterbox,2019-04-15 11:51',
'lastUpdateTime' => '2019-04-15 11:51'
)
)
)
);
foreach($array['data']['items'] as $item){
foreach($item['origin_info']['trackinfo'] as $trackinfo){
echo $trackinfo['checkpoint_status'].PHP_EOL;
}
}
- Output for 7.1.25 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- delivered
transit
transit
transit
preferences:
119.55 ms | 403 KiB | 169 Q