複製程式
<?php
$url = "[url]http://www.ettoday.com/common/ticker.htm";[/url]
$pattern = "/(<([aA]) .* target='_blank'>)(.*)(<\/[aA]>)(.*)(<\/font>)/";
$results="";
$fp = fopen($url,"r");
do {
$_data = fread($fp, 2048);
if (strlen($_data) == 0) {
break;
}
$results .= $_data;
} while(true);
fclose($fp);
preg_match_all($pattern,$results,$links);
while(list($Key,$Val) = each($links[0])){
$Val = str_replace ("</font>","</font>\";",$Val);
echo $Val;
}
?>