how loop through a JSON Array of bitcoin transaction data

0 votes

My code is:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$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>';
Sep 21, 2018 in Blockchain by digger
• 27,620 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
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

answered Sep 21, 2018 by slayer
• 29,040 points

Related Questions In Blockchain

0 votes
1 answer

In hyperledger, how many number of ordering node can take up a transaction?

There are two types to implement ordering: 1. ...READ MORE

answered Jun 25, 2018 in Blockchain by Omkar
• 65,850 points

edited Jun 28, 2018 by Omkar 190 views
0 votes
1 answer

How to set the hex-encoded data field in a Web3j Ethereum transaction?

You can use the "data" field of ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 65,850 points
+1 vote
1 answer

How does a miner get to know that a transaction is verified by all the nodes?

Contrary to the popular belief, it is ...READ MORE

answered Mar 26, 2018 in Blockchain by Johnathon
• 9,050 points
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,320 points
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
0 votes
1 answer
0 votes
1 answer

How to write a program to get details of ERC tokens?

You can use Javascript with the Metamask ...READ MORE

answered Jul 13, 2018 in Blockchain by slayer
• 29,040 points
0 votes
2 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.