|
首頁.論壇.加入最愛.設為首頁.註冊會員
/?php
/* weather */
$weatherURL='http://www.hko.gov.hk/textonly/forecast/chinesewx.htm/'; //即日天氣
$weatherURL2='http://www.hko.gov.hk/textonly/forecast/ndayc.htm/'; //七天天氣預報
$file=file($weatherURL);
$temperature = $file[14]; //line 15
$temperature2 = ereg_replace("現時氣溫: ","","$temperature");
$temperature2 = ereg_replace(" 度","","$temperature");
$temperature2 = ereg_replace("\n","","$temperature");
$temperature3 = $file[15]; //line 16
$temperature_3 = ereg_replace("相對濕度: ","","$temperature3");
$temperature_3 = ereg_replace("%","","$temperature3");
$temperature_3 = ereg_replace("\n","","$temperature3");
echo "現 時 ".$temperature2." 、 ".$temperature_3."%" ;
?>
在線人數:4 2024年10月09日 (星期三) 10:51:39 |