I am trying to implement this Google Finance Convertor in my project. I implemented it and it was working fine then. But today when I rechecked my application to ensure every thing is working properly I found out that the Google Finance Convertor API is not working and also returning an error.
PHP Code
/*********** Google Finance API ************/
$from_Currency = "USD";
$to_Currency = "INR";
$encode_amount = $amount;
$get = file_get_contents("http://finance.google.com/finance/converter?a=$encode_amount&from=$from_Currency&to=$to_Currency");
$get = explode("<span class=bld>",$get);
$get = explode("</span>",$get[1]);
$converted_currency = preg_replace("/[^0-9\.]/", null, $get[0]);
/*********** End Google Finance API ************/
It returns something like Undefined offset: 1
Complete Error Code
Notice: Undefined offset: 1 in E:\xampp\htdocs\sitesedapple\gateways\payumoney\payumoney.php on line 31
Here in my code this line represents line number 31
$get = explode("</span>",$get[1]);
Please help.