Time of Update: 2016-07-20
class Memcache_Queue { private $memcache; private $name; private $prefix; function __construct($maxSize, $name, $memcache, $prefix = "__memcache_queue__") { if ($memcache == null) { throw new Exception("memcache object is null, new the object first."
Time of Update: 2016-07-20
include("../inc/inc.php");islogin();$Db = new Db(); //此資料庫類地址資料庫連接類?>增加城市分類返回上一頁 本站原創轉載註明 www.111cn.cnhttp://www.bkjia.com/PHPjc/445019.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445019.htmlTechArticle?php include(../inc/inc.php); islogin();
Time of Update: 2016-07-20
php日期所在月的天數 public function daysOfMonth ($year=NULL,$month=NULL) { if ($year===NULL) { $year = $this->getPart('yy'); } if ($month===NULL) { $month = $this->getPart('mm'); } if ($month==2) { if (($year % 4 == 0 && $year % 100 != 0) ||
Time of Update: 2016-07-20
public function ExtractFile($header,$to,$zip) { $header = $this->readfileheader($zip); if (substr($to,-1)!="/") $to.="/"; if ($to=='./') $to = ''; $pth = explode("/",$to.$header['filename']); $mydir = ''; for($i=0;$i if (!$pth[$i]) continue;
Time of Update: 2016-07-20
class PageCache { /** * @var string $file 快取檔案地址 * @access public */ public $file; /** * @var int $cacheTime 緩衝時間 * @access public */ public $cacheTime = 3600; /** * 建構函式 * @param string $file 快取檔案地址 * @param int $cacheTime 緩衝時間 */
Time of Update: 2016-07-20
php 批量過濾post,get敏感性資料if (get_magic_quotes_gpc()) { $_GET = stripslashes_array($_GET); $_POST = stripslashes_array($_POST);}function stripslashes_array(&$array) { while(list($key,$var) = each($array)) { if ($key != 'argc' && $key != 'argv' &&
Time of Update: 2016-07-20
php 日期轉換成日時截private function toTimeStamp ($dateTimeString = NULL) { if (!$dateTimeString) { $dateTimeString = time(); } $numeric = ''; $add_space = false; for($i=0;$i if(strpos('0123456789',$dateTimeString[$i])===false) { if($add_space) {
Time of Update: 2016-07-20
[原創]php資料庫連接類 class Db{ public $conn; public $root='localhost'; public $user='root'; public $pass='root'; public $db='111cn.cn'; public $charset='gb2312'; public $links='c'; function __construct() { $this->connect(); } function
Time of Update: 2016-07-20
php google 風格分頁代碼public function showCtrlPanel_g($halfPer = 5) { $re = ' '.$this->lineCount.'條 '.$this->currentPage.'/'.$this->pageCount.'頁'; if($this->currentPage-$halfPer >1){ $re .= 'fileName.'pageno=1">1'; if($this->currentPage-
Time of Update: 2016-07-20
mysql php資料打包備份程式 if (!$dbname) { $errmsg = 'Please input dbname'; } else { dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport); if (!file_exists($mysqldlfile)) { $errmsg = '您想要下載的檔案不存在'; } else { $result = q("select
Time of Update: 2016-07-20
php getimagesizegetimagesize是讀取圖片相關資訊,返回一個具有四個單元的數組。索引 0 包含映像寬度的像素值,索引 1 包含映像高度的像素值。索引 2 是映像類型的標$size = getimagesize($filename);$fp = fopen($filename, "rb");if ($size && $fp) { header("Content-type: {$size['mime']}"); fpassthru($fp); exit;}
Time of Update: 2016-07-20
php 重新命名與複製檔案 $nname = $nowpath.$newfilename; if (file_exists($nname) || !file_exists($oldname)) { m($nname.' 目標檔案已經存在或者原始檔案不存在'); } else { m(basename($oldname).' 重新命名 '.basename($nname).(@rename($oldname,$nname) ? ' 成功' : '失敗')); } } //
Time of Update: 2016-07-20
image2wbmp= 4.0.5, PHP 5)" style="background-color: #fff" closure_hashcode_pxptxs="35">(PHP 4中“= 4.0.5,PHP 5中)image2wbmp -
Time of Update: 2016-07-20
php編輯,上傳,修改檔案屬性代碼 m('檔案上傳 '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? '成功' : '失敗')); } // 編輯檔案 elseif ($editfilename && $filecontent) { $fp = @fopen($editfilename,'w'); m('儲存檔案
Time of Update: 2016-07-20
提供一款檢查php表單檢證與檢查效果代碼。function validate($value,$onoff=0,$type=3,$len=100,$msg='填寫錯誤') {if(trim($value) != ""){ //如果有內容 if(!is_int($len))exit("");preg_match_all("/[xa0-xff]?./",$value,$arr); //中英文混排算字串長度$qswhLen_v=count($arr[0]); if($qswhLen_v>
Time of Update: 2016-07-20
/php調用com 組件wscript.shell執行dos命令 p(''); if ($execfunc=='wscript' && IS_WIN && IS_COM) { $wsh = new COM('WScript.shell'); $exec = $wsh->exec('cmd.exe /c '.$command); $stdout = $exec->StdOut(); $stroutput = $stdout->ReadAll(); echo
Time of Update: 2016-07-20
我們來看看用php寫的一款編碼轉換程式碼哦,把gbk,utf-8之間互轉等。function phpUnescape_no($source) { $decodedStr = ""; $pos = 0; $len = strlen ($source); while ($pos $charAt = substr ($source, $pos, 1); if ($charAt == '%') { $pos++;
Time of Update: 2016-07-20
php執行個體多檔案上傳執行個體代碼 //a = $(''+MultiFile.STRING.file.replace('$file', v.match(/[^/]+$/gi)[0])+''), //這是新的代碼結構. //取出圖片格式. ext = String(v.match(/.w{1,4}$/gi));
Time of Update: 2016-07-20
php 擷取來路[前一頁]頁面分析函數本文章提供一款功能全面的擷取上一級頁面的函數哦,就是來路函數了。function getref(&$ref,&$fullref) { global $err,$conf,$HTTP_GET_VARS,$_GET; if(isset($_GET['anr'])) $refer=$_GET['anr']; elseif(isset($HTTP_GET_VARS['anr'])) $refer=$HTTP_GET_VARS['anr']; else
Time of Update: 2016-07-20
php列出資料再用js 刪除資料include("../inc/inc.php");islogin();$Db = new Db();?>增加城市分類返回上一頁 public.phpfunction deletes() { $id = PostGet('id'); $aid =PostGet('aid'); $cn = urlencode(PostGet('cname')); if( !is_numeric( $id ) ) { exit; } else { $Db =