本教程主是讲三几点如下
获取格式化的日期和时间。
处理unix时间戳。
获取日期和时间的信息。
日期的计算。
验证日期的有效性。
*/
//获取格式化的日期和时间
本教程主是讲三几点如下
获取格式化的日期和时间。
处理unix时间戳。
获取日期和时间的信息。
日期的计算。
验证日期的有效性。
*/
//获取格式化的日期和时间
//方法二
/*
正则表达式到底是什么东西?
function page($sql,$pagesize=10,$class=""){
 
 if(!is_string($sql)){ return 0;exit;}
 $result=mysql教程_query($sql);
 if(!$result){return 0;exit;}
 if(!$recordnum=mysql_num_rows($result)){return 0;exit;}
 $totalpage=ceil($recordnum/$pagesize);
 $page=(int)$_get['page'];
 if($page<=1) $page=1;
 if($page>=$totalpage) $page=$totalpage;
 $recordno=($page-1)*$pagesize;
 $sql.=" limit $recordno,$pagesize";
 $result=mysql_query($sql);
 $url=$_server["php_self"];
function upfile($filename,$type,$path)
{
$tempfile=$_files[$filename];//接收上传的临时文件
$allow_url_override = 1; // set to 0 to not allow changed via post or get
if(!$allow_url_override || !isset($file_to_include))
{
 $file_to_include = "phprm.com.xls";
}
if(!$allow_url_override || !isset($max_rows))
{
 $max_rows = 0; //use 0 for no max
}
if(!$allow_url_override || !isset($max_cols))
{
 $max_cols = 5; //use 0 for no max
}
if(!$allow_url_override || !isset($debug))
{
 $debug = 0;  //1 for on 0 for off
}
if(!$allow_url_override || !isset($force_nobr))
{
 $force_nobr = 1;  //force the info in cells not to wrap unless stated explicitly (newline)
}
//survey.php
<?
//###########################################################
//
// for questions and comments
// roland (alias -=: vlieg :=-)
// icq #78354631
// mail: vlieg@atoomnet.net
//
// nb: this script won't work on free hosting pages, because of the secure mode!
// nb: you must have registered your icq# at http://web.icq.com/sms/login/ in order for this script to work
//###########################################################
conn.php文件
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script >
var xmlhttp
function showhint(str)
{
if (str.length==0)
  {
  document.getelementbyid("txthint").innerhtml=""
  return
  }
xmlhttp=getxmlhttpobject()
if (xmlhttp==null)
  {
  alert ("browser does not support http request")
  return
  }
xmlhttp.onreadystatechange=statechanged
 
$file="./www.phprm.com/file.cache";  
 
$array = array("count" => "3000",  "num"  =>"300"); 
 
//缓存  
 
mysql教程_connect('localhost','root','root');
mysql_select_db('abc');
mysql_query("set names 'gbk'");
$sql = "select a.itemid,a.lastpost,a.city,b.thumbpath from supe_spaceitems  a left join supe_attachments  b on a.itemid = b.itemid where a.picid>0 order by a.itemid desc limit 0,3";
 
 $query  = mysql_query( $sql );
 while( $k = mysql_fetch_array( $query ) )
 {
  $str .= "<a href='/a/'".date("ymd",$k['lastpost']).'/v-'.$k['itemid'].".html><img src=".$url.'/attachments/'.$k['thumbpath']." /></a>";
 } 
//搜索csv中指定内容
$fh = @fopen("csv_file_name", "r");
if($fh) {
   if(flock($fh, lock_ex)) {
      while(!feof($fh)) {
         $line = fgets($fh);
         if(strstr($line, $target_email_address) !== false) {
            $data = split(",", $line); // $data *is* an array
         }
      }
      flock($fh, lock_un);
   }
首先我们来创建搜索数据表
create table if not exists `search` (
  `id` int(4) not null auto_increment,
  `keyword` varchar(500) not null,
  primary key  (`id`)
) engine=myisam default charset=utf8 auto_increment=1 ;