欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

一个域名查询的程序

程序员文章站 2022-03-31 12:11:03
(主要用了两个字符串函数implode()和explode) 我制作的域名查询的源代码,主要用了两个字符串函数implode()和explode,利用这两个函数的切割字符...
(主要用了两个字符串函数implode()和explode)
我制作的域名查询的源代码,主要用了两个字符串函数implode()和explode,利用这两个函数的切割字符串的强大功能,可以查询.com,.net.,org.,cc.,tv下的域名whois。
<?php
echo '<center><form>';
echo '<input type="text" name="string">';
echo '<input type="submit" value="查询">';  
echo "</form>";
if (isset($string))  
{
$url = "http://networksolutions.com/cgi-bin/whois/whois?string=".$string."&string=search";  
$str = implode("",file($url));        
$aa= explode("<pr",$str);      
$bb=$aa[1];
$cc=explode("re>",$bb);
$dd= $cc[0];
$ee=explode("e>",$dd);
$ff=implode("<pre>",$ee);
$hh=explode("</p",$ff);
$jj=implode("</pre>",$hh);
$kk=explode("registrant",$jj);
$ll=implode("<font color=red>注册人</font>",$kk);
$mm=explode("domain name",$ll);
$nn=implode("<font color=red>域名</font>",$mm);
$oo=explode("administrative contact",$nn);
$pp=implode("<font color=red>管理联系人</font>",$oo);
$qq=explode("technical contact",$pp);
$ii=implode("<font color=red>技术联系人</font>",$qq);
$ss=explode("record last updated on",$ii);
$tt=implode("<font color=red>最后更新日期:</font>",$ss);
$uu=explode("record expires on",$tt);
$vv=implode("<font color=red>域名到期日期:</font>",$uu);
$ww=explode("record created on",$vv);
$xx=implode("<font color=red>域名注册日期:</font>",$ww);
$yy=explode("database last updated on",$xx);
$zz=implode("<font color=red>数据库更新日期:</font>",$yy);
$aaa=explode("record updated on",$zz);
$bbb=implode("<font color=red>记录更新日期:</font>",$aaa);
$ccc=explode("admin name",$bbb);
$ddd=implode("<font color=red>管理联系人</font>",$ccc);
$eee=explode("tech name",$ddd);
$whois=implode("<font color=red>技术联系人</font>",$eee);
}
echo '<center><table width="50%" border="0" cellspacing="1" cellpadding="0" bgcolor="#ff6666">';
echo '<tr bgcolor="#ffcc33">';
echo "<td>";
echo '<div align="center">域名whois查询系统</div>';
echo "</td>";
echo "</tr>";
echo '<tr bgcolor="#ffffff">';  
echo "<td>";
echo '<div align="left">';
echo "<br>";
echo $whois;
echo "</div>";
echo "</td>";
echo "</tr>";
echo '<tr bgcolor="#ffcc33">';
echo "<td>";
echo '<div align="center"><a href="http://www.phpcode.net"><font face="verdana, arial, helvetica, sans-serif">phpcode.net</font></a></div>';
echo "</td>";
echo "</tr>";
echo "</table>";
?>