Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $URL='https://blockchain.info/ru/ticker';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$URL);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- $result=curl_exec ($ch);
- $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code
- curl_close ($ch);
- $currencies=json_decode($result,true);
- print_r($currencies['USD']['last']);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement