讓滑鼠有手指的樣子
<a href="JavaScript:void(0);" onclick="window.open('http://www.top-aplus.com/','','scrollbars=yes,resizable=yes');"><img src="/pub/img/front/aplus.gif "/></a>
<a href="JavaScript:void(0);" onclick="window.open('http://www.top-aplus.com/','','scrollbars=yes,resizable=yes');"><img src="/pub/img/front/aplus.gif "/></a>
<script language="javascript" type="text/javascript">
function view(t){
switch(t){
case 1:
document.getElementById("img").innerHTML = '<img src="/pub/archive/pics/<%if $this.veryhot_folder.0.Img != ""%><%$this.veryhot_folder.0.Img%><%else%>pic_no_pix_s.jpg<%/if%>" width="360" style="border:4px solid #FFF;">';
break;
case 2:
document.getElementById("img").innerHTML = '<img src="/pub/archive/pics/<%if $this.veryhot_folder.0.Pic1 != ""%><%$this.veryhot_folder.0.Pic1%><%else%>pic_no_pix_s.jpg<%/if%>" width="360" style="border:4px solid #FFF;">';
break;
case 3:
document.getElementById("img").innerHTML = '<img src="/pub/archive/pics/<%if $this.veryhot_folder.0.Pic2 != ""%><%$this.veryhot_folder.0.Pic2%><%else%>pic_no_pix_s.jpg<%/if%>" width="360" style="border:4px solid #FFF;">';
break;
case 4:
document.getElementById("img").innerHTML = '<img src="/pub/archive/pics/<%if $this.veryhot_folder.0.Pic3 != ""%><%$this.veryhot_folder.0.Pic3%><%else%>pic_no_pix_s.jpg<%/if%>" width="360" style="border:4px solid #FFF;">';
break;
}
}
</script>
<div style=" float:left;width:120px; height:120px;border:1px solid #CACACA; margin:2px;">
<a href="javascript:view(1)"><img height="120" width="120" src="/pub/archive/pics/<%if $index.Img != ""%><%$index.Img%><%else%>pic_no_pix_s.jpg<%/if%>" style="cursor: pointer;"></a></div>
<div style=" float:left;width:120px; height:120px;border:1px solid #CACACA; margin:2px;">
<a href="javascript:view(2)"><img height="120" width="120" src="/pub/archive/pics/<%if $index.Pic1 != ""%><%$index.Pic1%><%else%>pic_no_pix_s.jpg<%/if%>" style="cursor: pointer;"></a></div>
$html_path 設定要讀取的網頁
file_get_contents($html_path) 把讀趣的網頁轉成html存這字串中
highlight_string($result) 顯示html
eregi("123",$result.$temp) 把想要讀取的部分擷取出來
str_replace('123', '', $temp[0]);把不要的部分用空白取代
function exchange(){
$html_path = "http://consumer.chinatrust.com.tw/ch/int_rate/EX_RATE.html"; //國泰世華匯率
if ($html_path) {
$result = file_get_contents($html_path);
$result = iconv("big5","utf-8",$result);
//highlight_string($result); // 顯示html
}else {
//echo "錯誤 : 無法開啟網站!";
exit();
}
eregi('人 民 幣 / CNY 4.5760', $result, $temp); //設定過濾條件
$exchange_rate = array();
$exchange_rate[1] = str_replace('人 民 幣 / CNY ', '', $temp[0]);
$rate = 1/floatval($exchange_rate[1]);
return $rate;
}