Time of Update: 2016-07-25
$reader = PHPExcel_IOFactory::createReader('Excel5'); // 讀取 excel 檔案方式 此方法是讀取excel2007之前的版本 excel2007 為讀取2007以後的版本 也可以查\Classes\PHPExcel\Reader 檔案夾中的類(為所有讀取類,需要哪個填上哪個就行)$PHPExcel = $reader->load("info.xls"); // 檔案名稱$sheet = $PHPExcel->getSheet(0); /
Time of Update: 2016-07-25
require_once 'classes/phpexcel/reader/excel2007.php'; require_once 'classes/phpexcel/reader/excel5.php'; include 'classes/phpexcel/iofactory.php'; function arraytoexcel($data){ $objphpexcel = new phpexcel();
Time of Update: 2016-07-25
本文介紹了php中日期與時間函數的具體用法,感興趣的朋友參考下。主要介紹date、getdate、mktime、checkdate等日期與時間函數的用法。 (1)date用法:date(格式,[時間]);如果沒有時間參數,則使用目前時間.格式是一個字串,其中以下字元有特殊意義:U 替換成從一個起始時間(好象是1970年1月1日)以來的秒數Y 替換成4位的年號.y 替換成2位的年號.F 替換成月份的英文全稱.M 替換成月份的英文簡稱.m 替換成月份數.z 替換成從當年1月1日以來的天數.d
Time of Update: 2016-07-25
$db['default']['hostname'] = SAE_MYSQL_HOST_M;$db['default']['username'] = SAE_MYSQL_USER;$db['default']['password'] = SAE_MYSQL_PASS;$db['default']['database'] = SAE_MYSQL_DB;$db['default']['dbdriver'] = 'mysqli';$db['default']['dbprefix'] = '';$db[
Time of Update: 2016-07-25
在php編程中如何用好Regex?phpRegex用法,需要的朋友參考下。本節內容:php RegexRegex是一種可以用於模式比對和替換的強有力的工具。可以在基於UNIX系統的工具中找到ta的身影。此外,象javascript這種用戶端的指令碼語言也提供了支援。Regex已經超出了某種語言或某個系統的局限,成為人們廣為接受的概念和功能,在很多的php教程中,這是必須要介紹的內容。以下是php中Regex的一些常用參數與格式,大家做個參考。文法格式:位於定界符"/"之間。較為常用的元字元包括:
Time of Update: 2016-07-25
require('smarty.class.php'); $smarty = new smarty; $smarty->caching = true;function smarty_block_dynamic($param, $content, &$smarty) { return $content; } $smarty->register_block('dynamic', 'smarty_block_dynamic', false);$smarty->display('index.tpl');
Time of Update: 2016-07-25
本文介紹了php中curl實現類比登入的一些教程,php類比登入教程大全,需要的朋友參考下。php類比登入專題教程大全PHP可以使用libcurl實現類比登入、提交資料。libcurl目前支援http、https、ftp、gopher、telnet、dict、file和ldap協議。libcurl同時也支援HTTPS認證、HTTP POST、HTTP PUT、 FTP 上傳(這個也能通過PHP的FTP擴充完成)、HTTP
Time of Update: 2016-07-25
endif;?>複製代碼2.load標籤第二個是load標籤,通過URL方式匯入當前項目的公用JS或者CSS,例如: 複製代碼在href屬性中可以使用特殊模板標籤替換,例如: 複製代碼Load標籤無需指定type屬性,系統會自動根據尾碼自動判斷。當然,load標籤也支援條件判斷調用: 複製代碼系統還提供了兩個標籤別名js和css 用法和load一致,例如: 複製代碼load標籤也支援同時匯入多個資源檔,甚至是不同類型的資源檔: 複製代碼
Time of Update: 2016-07-25
class CURL{var $cookie_file; // 設定Cookie檔案儲存路徑及檔案名稱 var $loginurl; //登陸地地址var $actionstr; //登陸參數function __construct(){ $this->cookie_file=tempnam("./TEMP","COOKIEdsdsdsdsdsdwerwdszx454.txt"); }function vlogin(){ //類比登入 by bbs.it-home.org $ch =
Time of Update: 2016-07-25
本文介紹了codeigniter啟用緩衝與清除緩衝的方法,依靠網頁緩衝,網頁可以達到近乎靜態網頁的載入速度,因為將程式輸出的結果儲存到硬碟上了。codeigniter啟用緩衝與清除緩衝人方法codeigniter 支援緩衝技術,以達到最快的速度。儘管ci已經相當高效了,但是網頁中的動態內容、主機的記憶體cpu
Time of Update: 2016-07-25
/*** php擷取圖片顏色值* by bbs.it-home.org*/$i=imagecreatefromjpeg("photo3.jpg");//測試圖片,自己定義一個,注意路徑for ($x=0;$x for ($y=0;$y $rgb = imagecolorat($i,$x,$y); $r=($rgb >>16) & 0xFF; $g=($rgb >> & 0xFF; $b=$rgb & 0xFF; $rTotal += $r; $gTotal
Time of Update: 2016-07-25
$urlToEncode="http://gz.altmi.com";generateQRfromGoogle($urlToEncode);function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0'){$url = urlencode($url);echo '';}複製代碼2.php類庫PHP QR Code地址:http://phpqrcode.sourceforge.net/下載:http:
Time of Update: 2016-07-25
header("content-type:text/html; charset=xxx")AddDefaultCharset xxx複製代碼建議為每個頁面都加個header("content-type:text/html; charset=xxx"),這樣就可以保證它在任何伺服器都能正確顯示,可移植性也比較強。 4)、PHP.ini 中的 default_charset 配置: php.ini 中的 default_charset = "gb2312"
Time of Update: 2016-07-25
/** * * @copyright 2007-2012 xiaoqiang. * @author xiaoqiang.wu * @version 1.01 */ error_reporting(e_all); date_default_timezone_set('asia/shanghai'); /** phpexcel_iofactory */require_once '../classes/phpexcel/iofactory.php'; // check
Time of Update: 2016-07-25
/** * 圖片加浮水印(適用於png/jpg/gif格式) * * @author flynetcn * * @param $srcImg 原圖片 * @param $waterImg 浮水印圖片 * @param $savepath 儲存路徑 * @param $savename 儲存名字 * @param $positon 浮水印位置 * 1:頂部居左, 2:頂部居右, 3:置中, 4:底部局左, 5:底部居右 * @param $alpha 透明度 --
Time of Update: 2016-07-25
/** * 完整詞的截取 * bbs.it-home.org 編輯整理 * @param $str * @param $start * @param $length * * @return string */ public static function usubstr($str, $start, $length = null) { // 先正常截取一遍. $res = substr($str, $start, $length);
Time of Update: 2016-07-25
$file = "temp.txt"; $fp = fopen($file , 'w'); if(flock($fp , LOCK_EX)){ fwrite($fp , "abc\n"); sleep(10); fwrite($fp , "123\n"); flock($fp , LOCK_UN); } fclose($fp); 複製代碼2) b.php $file = "temp.txt";
Time of Update: 2016-07-25
/* 檢查原始檔案是否存在及獲得原始檔案的資訊 */ $org_info = @getimagesize($img); $img_org = $this->img_resource($img, $org_info[2]); /* 原始圖片以及縮圖的尺寸比例 */ $scale_org = $org_info[0] / $org_info[1]; /* 處理只有縮圖寬和高有一個為0的情況,這時背景和縮圖一樣大 */ if ($thumb_width =
Time of Update: 2016-07-25
$filename = "./".$_REQUEST['name']; //具體路徑,只要$filename是所要下載檔案的完整路徑即可if (!is_file($filename)) {//檢測檔案是否存在. die('下載的檔案好像跟TM誰私奔啦!');}$filepath = str_replace('\\', '/', realpath($filename));$filesize = filesize($filepath);$filename = substr(strrchr('/'.$
Time of Update: 2016-07-25
include "pager.class.php"; $CurrentPage=isset($_GET['page'])?$_GET['page']:1; //die($CurrentPage); $myPage=new pager(1300,intval($CurrentPage)); $pageStr= $myPage->GetPagerContent(); //echo $pageStr; $myPage=new pager(90,intval($CurrentPage));