<?php
function current_rate($price=1)
{
$url = "http://www.google.com/finance/converter?a=$price&from=USD&to=INR";
$data = file_get_contents($url);
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
$new_price = preg_replace("/[^0-9.]/", "", $converted[1]);
return $new_price;
}
echo "1$==".$current_dolar_rate=current_rate(1) ." INR";
?>
function current_rate($price=1)
{
$url = "http://www.google.com/finance/converter?a=$price&from=USD&to=INR";
$data = file_get_contents($url);
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
$new_price = preg_replace("/[^0-9.]/", "", $converted[1]);
return $new_price;
}
echo "1$==".$current_dolar_rate=current_rate(1) ." INR";
?>
No comments :
Post a Comment