首页 > php与数据库

ajax+php验证用户名重复代码实例

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.phprm.com/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>ajax+php验证用户名重复代码实例</title>

阅读全文

php ExcelReader 读取Excel类

$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)
}

阅读全文

php搜索csv表格中是否存在指定数据

//搜索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);
   }

阅读全文