Get the status of your Bitcoin Adress in PHP


SUBMITTED BY: Guest

DATE: Dec. 29, 2013, 2:58 p.m.

FORMAT: PHP

SIZE: 700 Bytes

HITS: 1382

  1. // Initialize session and set URL.
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, "http://blockchain.info/address/YOURADDRESSHERE?format=json");
  4. // Set so curl_exec returns the result instead of outputting it.
  5. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  8. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
  9. curl_setopt($ch, CURLOPT_TIMEOUT, 10); // timeout in seconds
  10. // Get the response and close the channel.
  11. $response = curl_exec($ch);
  12. curl_close($ch);
  13. $responseObj = json_decode($response);
  14. print_r($responseObj);

comments powered by Disqus