(主要用了兩個字串函數implode()和explode)
我製作的網域名稱查詢的原始碼,主要用了兩個字串函數implode()和explode,利用這兩個函數的切割字串的強大功能,可以查詢.com,.net.,org.,cc.,tv下的網域名稱whois。
echo '";
if (isset($string))
{
$url = "http://networksolutions.com/cgi-bin/whois/whois?STRING=".$string."&STRING=Search";
$str = implode("",file($url));
$aa= explode("$bb=$aa[1];
$cc=explode("re>",$bb);
$dd= $cc[0];
$ee=explode("e>",$dd);
$ff=implode("
",$ee);
$hh=explode("$jj=implode("
",$hh);
$kk=explode("Registrant",$jj);
$ll=implode("註冊人",$kk);
$mm=explode("Domain Name",$ll);
$nn=implode("網域名稱",$mm);
$oo=explode("Administrative Contact",$nn);
$pp=implode("管理連絡人",$oo);
$QQ=explode("Technical Contact",$pp);
$ii=implode("技術連絡人",$qq);
$ss=explode("Record last updated on",$ii);
$tt=implode("最後更新日期:",$ss);
$uu=explode("Record expires on",$tt);
$vv=implode("網域名稱到期日:",$uu);
$ww=explode("Record created on",$vv);
$xx=implode("網域名稱註冊日期:",$ww);
$yy=explode("Database last updated on",$xx);
$zz=implode("資料庫更新日期:",$yy);
$aaa=explode("Record updated on",$zz);
$bbb=implode("記錄更新日期:",$aaa);
$ccc=explode("Admin Name",$bbb);
$ddd=implode("管理連絡人",$ccc);
$eee=explode("Tech Name",$ddd);
$whois=implode("技術連絡人",$eee);
}
echo '
'; echo '
'; echo "
"; echo '網域名稱whois查詢系統'; echo " | "; echo "
"; echo '
'; echo "
"; echo ''; echo " "; echo $whois; echo ""; echo " | "; echo "
"; echo '
'; echo "
"; echo 'PHPcode.net'; echo " | "; echo "
"; echo "
";
?>