I am trying to use fedex shipping api by https://github.com/101medialab/shipping in my website. I am not good with php, when I try the code:
$calculator = new MediaLab\Shipping\Calculator\FedExCalculator($key,$password, $accountNumber, $meterNumber); $calculator->calculate($source, $destination, $shipment);
I can see a response from it like this:
Array
(
[0] => MediaLab\Shipping\Model\Estimation Object
(
[carrier:MediaLab\Shipping\Model\Estimation:private] => FedEx
[serviceName:MediaLab\Shipping\Model\Estimation:private] => First overnight
[serviceCode:MediaLab\Shipping\Model\Estimation:private] => FIRST_OVERNIGHT
[deliveryDate:MediaLab\Shipping\Model\Estimation:private] => DateTime Object
(
[date] => 2015-07-27 08:00:00
[timezone_type] => 3
[timezone] => Europe/Paris
)
[cost:MediaLab\Shipping\Model\Estimation:private] => MediaLab\Shipping\Model\Cost Object
(
[currency:MediaLab\Shipping\Model\Cost:private] => USD
[amount:MediaLab\Shipping\Model\Cost:private] => 161.59
)
)
[1] => MediaLab\Shipping\Model\Estimation Object
(
[carrier:MediaLab\Shipping\Model\Estimation:private] => FedEx
[serviceName:MediaLab\Shipping\Model\Estimation:private] => Priority overnight
[serviceCode:MediaLab\Shipping\Model\Estimation:private] => PRIORITY_OVERNIGHT
[deliveryDate:MediaLab\Shipping\Model\Estimation:private] => DateTime Object
(
[date] => 2015-07-27 10:30:00
[timezone_type] => 3
[timezone] => Europe/Paris
)
[cost:MediaLab\Shipping\Model\Estimation:private] => MediaLab\Shipping\Model\Cost Object
(
[currency:MediaLab\Shipping\Model\Cost:private] => USD
[amount:MediaLab\Shipping\Model\Cost:private] => 71.65
)
)
)
but I am confused on how can I get these value to show in a select list.