Author

Topic: Splitting arrays from an RPC call (Read 147 times)

btj
member
Activity: 115
Merit: 16
June 10, 2018, 01: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:
$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
member
Activity: 180
Merit: 52
June 09, 2018, 09:25:00 PM
#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
Jump to: