PHP function to Auto automatically convert and display dollar equivalent of your peso value.
Rates via Yahoo Finance, easy to use function, for everybody…
Read on…
CONST YAHOO_URL = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=%s%s=X'; function yahoo_convert($a,$from,$to){ $fo = @fopen(sprintf(self::YAHOO_URL,$from,$to), 'r'); if ($fo){ $response = fgets($fo, 4096); fclose($fo); array = explode(',',$response); if(strval($array[1]) > 0) { return strval($a)*strval($array[1]); } } return false; }
To use
<?php echo yahoo_convert(1,USD,PHP); ?>
For questions / help send me a message of just comment for help instructions…
I didn’t understand the concluding part of your article, could you please explain it more?
which part of it you do not understand? well to start, this is a PHP function and using this should look like
save it as a PHP for ex convert.php and run it to your server
Did I answer that correctly? clearly?
whicj part of it you do not understand? well to start, this is a PHP function and using this should look like
save it as a PHP for ex convert.php and run it to your server
Did I answer that correctly? clearly?
I didn’t understand the concluding part of your article, could you please explain it more?
I am not going to be original this time, so all I am going to say that your blog rocks, sad that I don’t have suck a writing skills
I really like when people are expressing their opinion and thought. So I like the way you are writing