Select 4 shengmu letters domain name from database


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3.  * Author: polo.mp
  4.  * Data: 2009-03-26
  5.  * Url: http://www.pjoke.com/tools/domain/4shengmu.php
  6.  */
  7. date_default_timezone_set(RPC); //设置默认时区为中国
  8. $smfile = "4shengmu.html";
  9. $smTime = 0;
  10. if (file_exists($smfile)) {
  11. $smTime = date("YmdH", filemtime($smfile));
  12. }
  13. $nowTime = date("YmdH", time());
  14.  
  15. if ($nowTime - $smTime > 1) { //1小时1次
  16. $fp = fopen($smfile, 'wb');
  17. }
  18. else {
  19. $fp = fopen($smfile, 'rb');
  20. include("header.php");
  21. fpassthru($fp);
  22. include("footer.php");
  23. fclose($fp);
  24. }
  25.  
  26. require_once('../../db/jk-config.php');
  27.  
  28. $sqlstr = "select * from pooldrop where length(`name`)<5 and `name` not regexp '[^b-df-hj-np-tw-z]' and `type`='com'";
  29.  
  30. $result = $jkdb->get_results($sqlstr);
  31.  
  32. $htmltext = "<p>待删除的4声母域名(.com)</p></td>
  33. </tr>
  34. <tr><td></td></tr>
  35. <tr>
  36. <td width=\"773\" colspan=\"2\">";
  37. if ($result) {
  38. $htmltext.= "<table><tr><td>4声母</td><td>后缀</td><td>删除日期(美国东部时间)</td></tr>";
  39. foreach ($result as $re) :
  40. $htmltext .= "<tr><td>".$re->name."</td><td>".$re->type."</td><td>".$re->date."</td></tr>";
  41. endforeach;
  42. $htmltext .= "</table>";
  43. }
  44.  
  45. fwrite($fp, $htmltext);
  46. fclose($fp);
  47. include("header.php");
  48. echo $htmltext;
  49. include("footer.php");
  50. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.