2016-04-12 16 views
0

配送料金を計算しようとしていますが、REST APIからの応答があります。私は "delivery_charges"フォーム応答配列の値を返すようにしたいですか?配列からマゼンタの単一オブジェクト値を取得する方法は?

Array 
(
[response] => Array 
    (
     [delivery_charges] => 41 
     [return_charges] => 83 
     [all_charges] => Array 
      (
       [DL] => 32 
       [FS] => 30 
       [DTO] => 0 
       [RTO] => 32 
       [ST] => 14.5 
       [COD] => 0 
       [TDS] => 0 
       [CARD] => 0 
       [CNC] => 0 
      ) 

     [canc_charges] => 0 
     [pickup_charges] => 0 
     [params] => Array 
      (
       [md] => E 
       [pt] => prepaid 
       [cl] => xxxxxxx 
       [o_pin] => 560076 
       [d_pin] => 560062 
       [token] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
       [gm] => 100 
       [d_city] => Bangalore 
       [o_city] => Bangalore 
      ) 

    ) 

答えて

0

私はちょうどあなたが単に末尾に次を追加する必要が

return $shipping_charge['response']['delivery_charges']; 
0

を使用して答えを得ました。 $ shipping_chargeが配列の場合、

return $shipping_charge['response']['delivery_charges'];

関連する問題