<table border=0 bgcolor=lightyellow align=center>
<tr align="center"><td align="center">
<center>
<form>
<input type="text" name="keyword" size="30">
<input type="submit" name="submit1" value="GOOGLE 搜索">
</form>
</center>
</td></tr></table></body>
@$keyword=urlencode($_GET[keyword]);//URL编码,防止出现乱码
$urlvalue="[url]http://www.google.cn/search?hl=zh-CN&q=[/url]".$keyword."&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f";
$result=file($urlvalue); //取得数组
echo "<table border=1 align='center'>";
for($i=0;$i<count($br_array)-1;$i++)
{
$br_array[$i]=str_replace("翻译此页","",$br_array[$i]);
$br_array[$i]=str_replace("网页快照","",$br_array[$i]);
$br_array[$i]=str_replace("-","",$br_array[$i]);
$br_array[$i]=str_replace("类似网页","",$br_array[$i]);
preg_match_all('/<a(.*?)href="(.*?)"(.*?)>(.*?)<\/a>/i',$br_array[$i],$newresult);
//网站连接地址
@$linkstr=$newresult[2][2];
//echo 连接字符表面
$linkname="<font size=4 color=lightred>".@$newresult[4][2]."</font>";
echo "<br>";
//组合显示
$total="<a href=".$linkstr;
$total=$total." target=_blank style='text-decoration:none'>".$linkname."</a>";
echo $total;
echo "<br>";
}
echo "</table>";
















