How to grab BCA USD buy/sell rate with cURL?
This will grab current rate of USD rate from BCA using cURL. function delAttr($tagSource) { $stripAttrib = “‘ (style|class)=\”(.*?)\”‘i”; $tagSource = stripslashes($tagSource); $tagSource = preg_replace($stripAttrib, ”, $tagSource); return $tagSource; } function delTags($source) { $allowedTags=”; $source = strip_tags($source, $allowedTags); return preg_replace(‘/<(.*?)>/ie’, “‘<‘.delAttr(‘\\1′).’>'”, $source); } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, “http://www.klikbca.com/individual/silver/ind/rates.html”); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,…
Read More »