匯控各上市地股價換算港元

(.*)
!iU'; // preg_match_all($regexp,$input,$output); // $hsbc_adr=$output[1][0]; // Get HSBC 0005.HK Stock price - $hsbc_hk // $url = "http://hk.finance.yahoo.com/q?s=0005.hk"; // $input = @file_get_contents($url); // $regexp = '!(.*)
!iU'; // preg_match_all($regexp,$input,$output); // $hsbc_hk=$output[1][0]; // Get HSBC from aastock $url = "http://www.aastocks.com/tc/mobile/Quote.aspx?symbol=5"; $input = @file_get_contents($url); $regexp = '! (.*)!iU'; preg_match_all($regexp,$input,$output); $hsbc_hk = $output[1][0]; // Get HSBC Paris (HBC1.F) stock price - hsbc_paris // $url = "http://hk.finance.yahoo.com/q?s=HBC1.F"; // $input = @file_get_contents($url); // $regexp = '!(.*)
HKD rate // $url = "http://hk.finance.yahoo.com/q?s=USDHKD=X"; // $input = @file_get_contents($url); // $regexp = '!(.*)
!iU'; // preg_match_all($regexp,$input,$output); // $usd_rate=$output[1][0]; // Get Euro -> HKD rate // $url = "http://hk.finance.yahoo.com/q?s=EURHKD=X"; // $input = @file_get_contents($url); // $regexp = '!(.*)
!iU'; // preg_match_all($regexp,$input,$output); // $euro_rate=$output[1][0]; // Get GBP -> HKD rate // $url = "http://hk.finance.yahoo.com/q?s=GBPHKD=X"; // $input = @file_get_contents($url); // $regexp = '!(.*)
!iU'; // preg_match_all($regexp,$input,$output); // $gbp_rate=$output[1][0]; // ADR and ordinary share rate $adr=5; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
Exchange MarketPriceHKD
HSBC
(Hong Kong,0005)
'.number_format($hsbc_hk,2).'
HSBC
(Paris, HBC)
Euro $'.$hsbc_paris.''.number_format($hsbc_paris*$euro_rate,2).'
HSBC
(London, HSBA.L)
GBP $'.$hsbc_london.'
'.number_format($hsbc_london*$gbp_rate/100,2).'
HBC
(US ADR)
USD $'.$hsbc_adr.'
'.number_format($hsbc_adr*$usd_rate/$adr,2).'
'; echo '
1 USD $= HKD $'.$usd_rate.""; echo '
7.85 : 弱方兌換保證
7.75 : 強方兌換保證'; echo "
"; echo '
1 Euro $= HKD $'.$euro_rate.""; echo "
"; echo '
1 GBP $= HKD $'.$gbp_rate.""; echo "
"; echo '
1 Euro $ = $USD'.$euro_usd_rate.""; echo "
"; ?>
ADR = 5 ordinary shares


Reminder : 15 minutes delay 此為本人寫的小程式