0

I am having two bank account details,I got this an json format,i want to fetch available balance from this.Here is my sample output:var_dump($result2); I want to get available balances(1423,55158) in each account.I tried this:

        $myArray2 = json_decode($result2,true);
        foreach($myArray2 as $row2) {
                $balance=$row2['itemData']['accounts'];
}
}

i did not get the answer.pls help.

1 Answer 1

2

Try this:

foreach($myArray2["itemData"]["accounts"] as $account) {
    $balance = $account['availableBalance']['amount'];
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.