Return to Snippet

Revision: 12718
at March 25, 2009 22:07 by zhengrenchi


Initial Code
<?php
/*
 * Author: polo.mp
 * Data:   2009-03-26
 * Url:    http://www.pjoke.com/tools/domain/4shengmu.php
 */
set_time_limit(0);
date_default_timezone_set(RPC); //设置默认时区为中国
$smfile = "4shengmu.html";
$smTime = 0;
if (file_exists($smfile)) {
    $smTime = date("YmdH", filemtime($smfile));
}
$nowTime = date("YmdH", time());

if ($nowTime - $smTime > 1) {  //1小时1次
    $fp = fopen($smfile, 'wb');
}
else {
    $fp = fopen($smfile, 'rb');
include("header.php");
    fpassthru($fp);
include("footer.php");
    fclose($fp);
    exit;
}

require_once('../../db/jk-config.php');

$sqlstr = "select * from pooldrop where length(`name`)<5 and `name` not regexp '[^b-df-hj-np-tw-z]' and `type`='com'";

$result = $jkdb->get_results($sqlstr);

$htmltext = "<p>待删除的4声母域名(.com)</p></td>
  </tr>
  <tr><td></td></tr>
  <tr>
<td width=\"773\" colspan=\"2\">";
if ($result) {
    $htmltext.= "<table><tr><td>4声母</td><td>后缀</td><td>删除日期(美国东部时间)</td></tr>";
    foreach ($result as $re) :
    	$htmltext .= "<tr><td>".$re->name."</td><td>".$re->type."</td><td>".$re->date."</td></tr>";
	endforeach;
	$htmltext .= "</table>";
}

fwrite($fp, $htmltext);
fclose($fp);
include("header.php");
echo $htmltext;
include("footer.php");
?>

Initial URL
http://www.pjoke.com/tools/domain/4shengmu.php

Initial Description
用正则表达式从数据库中选出所有字母皆为声母的四字母域名

Initial Title
Select 4 shengmu letters domain name from database

Initial Tags


Initial Language
PHP