Hi Guys
I'm back...greetings to all and thanks for keeping in touch.
Not sure even where to post this question but php section usually is cool.
Is there any guru here willing to help me make a display of exchange rates on my site? I only need Euro, Sterling, USD and BG lev.
Regards
F
phobia1
0
Light Poster
Recommended Answers
Jump to PostWelcome back (I don't know you though). Could you explain what exactly are you looking for ?
Jump to PostI would surely love to see one..
Well here is a function:
function currency_convert($Amount,$currencyfrom,$currencyto) { $buffer=file_get_contents('http://finance.yahoo.com/currency-converter'); preg_match_all('/name=(\"|\')conversion-date(\"|\') value=(\"|\')(.*)(\"|\')>/i',$buffer,$match); $date=preg_replace('/name=(\"|\')conversion-date(\"|\') value=(\"|\')(.*)(\"|\')>/i','$4',$match[0][0]); unset($buffer); unset($match); $buffer=file_get_contents('http://finance.yahoo.com/currency/converter-results/'.$date.'/'.$Amount.'-'.strtolower($currencyfrom).'-to-'.strtolower($currencyto).'.html'); preg_match_all('/<span class=\"converted-result\">(.*)<\/span>/i',$buffer,$match); $match[0]=preg_replace('/<span class=\"converted-result\">(.*)<\/span>/i','$1',$match[0]); //return $buffer; unset ($buffer); return $match[0][0]; } //Theory: currency_convert(Amount,From,To) echo currency_convert(150.5,'GBP','AUD');
And the possible …
All 8 Replies
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
phobia1
0
Light Poster
phobia1
0
Light Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
phobia1
0
Light Poster
waelm2010
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.