21544/how-loop-through-a-json-array-of-bitcoin-transaction-data
My code is:
$requesturl='https://blockchain.info/tx-index/1fda663d2584425f192eae045d3809950883ebe50f2222f98ef7d31f414f3f96?format=json'; $ch=curl_init($requesturl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $cexecute=curl_exec($ch); curl_close($ch); $result = json_decode($cexecute,true); // to get the first i use echo $result['out'][0]['addr']; to get the second I use echo $result['out'][0]['addr'];
Now my requirement is to look through the array using for each but its throwing error:
foreach ($result['out'] as $adressee) { echo $adressee.'<br>'; }
for($i=0; $i<count($result['out']); $i++) { echo $result['out'][$i]["addr"].'<br>'; }
Some Sample codes in PHP manual helped me come up with this solution
There are two types to implement ordering: 1. ...READ MORE
What is the argument utxos int the ...READ MORE
You can use the "data" field of ...READ MORE
I am trying to find out how ...READ MORE
yes all are over TCP/IP connections secured ...READ MORE
This was a bug. They've fixed it. ...READ MORE
Summary: Both should provide similar reliability of ...READ MORE
You can use Javascript with the Metamask ...READ MORE
The details like account balance, nonce etc., ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.