Author

Topic: I need help with campbx's api (Read 724 times)

sr. member
Activity: 448
Merit: 251
Bitcoin
April 04, 2013, 08:14:50 PM
#3
Thank you so much I'm on my mobile now but I'm going to test this second I get home!!
member
Activity: 105
Merit: 10
April 04, 2013, 07:47:29 PM
#2
$tuData = '{"Last Trade":"140.21","Best Bid":"137.50","Best Ask":"140.00"}';
$obj = json_decode($tuData);
$lastTrade = $obj->{"Last Trade"};
echo "Last Trade: ".$lastTrade."\n";
?>
sr. member
Activity: 448
Merit: 251
Bitcoin
April 03, 2013, 09:43:56 AM
#1
I need this

http://campbx.com/api/xticker.php

which outputs this

{"Last Trade":"140.21","Best Bid":"137.50","Best Ask":"140.00"}

to output just

140.21

Nothing more...  in PHP .. each time I try it I get an unexpected result...   

Can someone post a quick source on how to output it in this format?   It's to help with average spot price from all the exchanges,  campbx is one that for some reason gives me trouble even though it looks simple.



FILL IN CODE HERE

?>

Seriously I would appreciate it...   

Jump to: