daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Aug 21st, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ini_set('max_execution_time', 600);
  2.     function curl_get($host, $referer = null){
  3.         $ch = curl_init();
  4.  
  5.         curl_setopt($ch, CURLOPT_HEADER, 0);
  6.         curl_setopt($ch, CURLOPT_REFERER, $referer);
  7.         curl_setopt($ch, CURLOPT_USERAGENT, "Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.9.168 Version/11.51");
  8.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  9.         curl_setopt($ch, CURLOPT_URL, $host);
  10.         curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  11.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12.         define('CURLOPT_IPRESOLVE', 113);
  13.         define('CURL_IPRESOLVE_V4', 1);
  14.         $html = curl_exec($ch);
  15.         echo curl_error($ch);
  16.         curl_close($ch);
  17.         return $html;
  18.         }
  19.   $result = curl_get("https://mconvert.net/get-exchange-rates-widget?base=btc&amount=1&lang=ru&curr=kzt&theme=blue&type=1&font=1&ssl=1");
  20.    
  21. $fer = preg_match_all("~<span class="label label-default" style="background-color: #d9edf7; color: #2277BD;; font-size: 12px">s+(.*?)s+</span>~s",$result, $arr);
  22.     foreach($arr as $v) {
  23.     echo $v[0]."<br>";
  24.     echo $v[1];
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top