Bitcoin Forum
September 21, 2018, 01:24:44 AM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Splitting arrays from an RPC call  (Read 20 times)
The_Trader
Member
**
Offline Offline

Activity: 74
Merit: 28


View Profile
June 10, 2018, 02:25:00 AM
 #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
1537493084
Hero Member
*
Offline Offline

Posts: 1537493084

View Profile Personal Message (Offline)

Ignore
1537493084
Reply with quote  #2

1537493084
Report to moderator
Make a difference with your Ether.
Donate Ether for the greater good.
SPRING.WETRUST.IO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537493084
Hero Member
*
Offline Offline

Posts: 1537493084

View Profile Personal Message (Offline)

Ignore
1537493084
Reply with quote  #2

1537493084
Report to moderator
1537493084
Hero Member
*
Offline Offline

Posts: 1537493084

View Profile Personal Message (Offline)

Ignore
1537493084
Reply with quote  #2

1537493084
Report to moderator
1537493084
Hero Member
*
Offline Offline

Posts: 1537493084

View Profile Personal Message (Offline)

Ignore
1537493084
Reply with quote  #2

1537493084
Report to moderator
btj
Member
**
Offline Offline

Activity: 98
Merit: 13


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!