Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as text by Leonid ( 18 years ago )
<?php
		function get_rate($curr,$date)
		{
			$url='http://cbr.ru/currency_base/daily.asp';
//			$url='daily.html';
			$day=substr($date,0,2);
			$month=substr($date,2,2);
			$year=substr($date,4,4);
			$currency=$curr;
			$param_str="?C_month=$month&C_year=$year&date_req=$day%2F$month%2F$year";
			$url=$url.$param_str;
				$parse=file_get_contents($url, true);
				if($parse=strstr($parse,$currency)){
					$arr=explode(' ',strip_tags($parse));
					return $arr[0].' '.$arr[1];
				}
				else 
				{
					return 'Currency rate no found';
				}
		}
		ini_set("soap.wsdl_cache_enabled", "0");
		$soap=new SoapServer('soap.wsdl');
		$soap->addFunction('get_rate');
		$soap->handle();
?>

 

Revise this Paste

Your Name: Code Language: