Move specific value in PHP Array

2

I have a connection via api with a third party system, I am getting the values in this format:

Array ( [code] => 200 [data] => Array ( [subscription_id] => 2752 [status] => new [custom_id] => [charges] => Array ( [0] => Array ( [charge_id] => 97652 [status] => new [total] => 1990 [parcel] => 1 ) ) [created_at] => 2016-08-29 20:17:12 ) )

What I need is to get the value of charge_id , I think it's simple, but I did not find the exact way to find it.

    
asked by anonymous 30.08.2016 / 01:37

1 answer

2

I think you can use a foreach like this:

foreach($data['data']['carges'] as $key => $value)
{
    echo $value['charge_id'];
}
    
30.08.2016 / 01:45