Bitcoin Forum
May 11, 2024, 10:19:38 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 121 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
The trust scores you see are subjective; they will change depending on who you have in your trust list.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715422778
Hero Member
*
Offline Offline

Posts: 1715422778

View Profile Personal Message (Offline)

Ignore
1715422778
Reply with quote  #2

1715422778
Report to moderator
1715422778
Hero Member
*
Offline Offline

Posts: 1715422778

View Profile Personal Message (Offline)

Ignore
1715422778
Reply with quote  #2

1715422778
Report to moderator
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!