Bitcoin Forum
April 26, 2024, 02:18:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Splitting arrays from an RPC call  (Read 120 times)
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
June 10, 2018, 02:25:00 AM
Last edit: June 10, 2018, 12:44:03 PM by The_Trader
 #1

I'm trying to split the rpc call
Code:
print_r($bitcoin->getdifficulty());

If you take a look here it looks shitty http://91.121.133.197/test

Is the a way for me to print or display the POS diff and the POW diff on there own ?

Many Thanks
TT
1714097904
Hero Member
*
Offline Offline

Posts: 1714097904

View Profile Personal Message (Offline)

Ignore
1714097904
Reply with quote  #2

1714097904
Report to moderator
1714097904
Hero Member
*
Offline Offline

Posts: 1714097904

View Profile Personal Message (Offline)

Ignore
1714097904
Reply with quote  #2

1714097904
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
btj
Member
**
Offline Offline

Activity: 115
Merit: 16


View Profile
June 10, 2018, 06:31:42 PM
 #2

You will get more answers from here:
https://bitcointalk.org/index.php?board=4.0

Supposing you get this result:
Code:
Array ( [proof-of-work] => 6.2216203 [proof-of-stake] => 3.62663766 [search-interval] => 1 ) 

When you make:
Code:
print_r($bitcoin->getdifficulty());

To display them separately:
Code:
<?php
$difficulty 
$bitcoin->getdifficulty();

// Show PoW
echo $difficulty["proof-of-work"];

// Show PoS
echo $difficulty["proof-of-stake"];
?>

Learn basics of Arrays from here:
http://php.net/manual/en/language.types.array.php
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!