Time of Update: 2016-07-25
/** * @file class.qqhttp.php * qq郵箱登陸擷取類 * @author wc * @site bbs.it-home.org */ class QQHttp {
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
/** * 匯出資料到CSV檔案 * @param array $data 資料 * @param array $title_arr 標題 * @param string $file_name CSV檔案名稱 */function export_csv(&$data, $title_arr, $file_name = '') { ini_set("max_execution_time", "3600"); $csv_data = ''; /** 標題 */ $nums
Time of Update: 2016-07-25
$url = '';//正方教務系統登入地址$ID = '';$PA = '';$cookieid = Get_SessionId($url);//擷取登入頁面的會話ID/* is_login()函數判斷是否登入成功*/ function is_login() { global $url,$ID,$PA,$cookieid; preg_match('#value="([^"]+)"#', curl_get($url), $vi); $p =
Time of Update: 2016-07-25
function datezhuanhuan($dateparams){$ccc=strtotime($dateparams);$date=date(‘Y-m-d');$bjtime=date(‘Y-m-d',$ccc);if($date==$bjtime){$sbjtime=date(‘Y-m-d H:i:s',$ccc);echo substr($sbjtime,11,5);} // bbs.it-home.orgelse{$sbjtime=date(‘Y-m-d H:i:s',$ccc);
Time of Update: 2016-07-25
圖片匯入 複製代碼2,php代碼(檔案上傳,以時間戳記命名檔案,session中儲存檔案路徑) /***Mwbe Version1.0*-----------------------------------------------*Copy 2013-2014 ylt*Web: communicate*-----------------------------------------------*Author: tao *Data:
Time of Update: 2016-07-25
$cookie_jar = dirname(__file__)."/pic.cookie"; 複製代碼二、擷取cookie將cookie存入檔案 $url = "http://1.2.3.4/";$ch = curl_init();curl_setopt($ch, curlopt_url, $url);curl_setopt($ch, curlopt_header, 0);curl_setopt($ch, curlopt_returntransfer,
Time of Update: 2016-07-25
function match_links($document) { preg_match_all("']+))[^>]*>?(.*?)'isx",$document,$links); while(list($key,$val) = each($links[2])) { if(!empty($val)) $match['link'][] = $val; } while(list($key,$val) = each($links[3])) {
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
class Upload extends Controller { function go() { if(isset($_POST['go'])) { //初始化 $config['upload_path'] = 'album/source'; $config['allowed_types'] = 'gif|jpg|png|bmp|jpeg'; $config['encrypt_name'] = TRUE;
Time of Update: 2016-07-25
// Fix for removed Session functions function fix_session_register(){ function session_register(){ $args = func_get_args(); foreach ($args as $key){ $_SESSION[$key]=$GLOBALS[$key]; } } function session_is_registered($key){ return
Time of Update: 2016-07-25
本文介紹了codeigniter啟用緩衝與清除緩衝的方法,依靠網頁緩衝,網頁可以達到近乎靜態網頁的載入速度,因為將程式輸出的結果儲存到硬碟上了。codeigniter啟用緩衝與清除緩衝人方法codeigniter 支援緩衝技術,以達到最快的速度。儘管ci已經相當高效了,但是網頁中的動態內容、主機的記憶體cpu
Time of Update: 2016-07-25
/*** @功能:下載遠程圖片* @ bbs.it-home.org*/ function DownImageKeep($gurl, $rfurl, $filename, $gcookie="", $JumpCount=0, $maxtime=30) { $urlinfos = GetHostInfo($gurl); $ghost = trim($urlinfos['host']); if($ghost=='') { return
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
本文介紹了php非預置圖片產生驗證碼的方法,不需要事先預置驗證碼圖片在伺服器中,圖片背景繪製是隨機的,產生驗證碼的例子,需要的朋友參考下。php產生驗證碼php產生驗證碼的獨立頁,不需要事先預置驗證碼圖片在伺服器中,圖片背景繪製是隨機的。專題推薦:php驗證碼大全 在任何需要顯示驗證碼的頁面位置,用標籤載入該檔案訪問地址即可,伺服器端的驗證碼值存於session中:$_SESSION['randcode']完整代碼:
Time of Update: 2016-07-25
class CommonAction extends Action{ function verify(){ import('ORG.Util.Image'); //英文驗證碼 //Image::buildImageVerify(5,5,gif,90,30,'verify'); //中文驗證碼 Image::GBVerify(); } }?>複製代碼5,view模板部分:模板index.html頁面如下:
Time of Update: 2016-07-25
class cls{ public static function test($userName) { echo 'Hi, ' . $userName . "\n"; }} $className = 'cls'; $className::test('Tom'); // PHP >= 5.3.0 call_user_func(array($className, 'test'), 'Jack'); // PHP 3 >= 3.0.3, PHP 4,
Time of Update: 2016-07-25
/** * 使用者請求重設密碼的接收器 */function requestResetPassword() { //檢查使用者是否存在 if( !checkUserExists( $_GET['userid'] ) ) { exit('抱歉,使用者不存在,請確認使用者帳號。'); } resetPassword( $_GET['userid'] ); //最後向使用者發送一封郵件 sendEmail( $_GET['userid'],
Time of Update: 2016-07-25
本文介紹了php類中靜態方法與靜態變數的用法區別,如果是非靜態方法,需要改方法中沒有使用$this,即沒有調用非靜態變數/方法,當然,調用靜態變數/方法沒有問題。有關php靜態方法與靜態變數的用法。在php中,訪問類的方法/變數有兩種方法:1、建立對象$object = new
Time of Update: 2016-07-25
class Page{private $total; //資料表中總記錄數private $listRows; //每頁顯示的條數private $limit; //SQL語句中使用limit從句,限制擷取記錄數private $uri; //自動擷取url的請求地址private $pageNum; //總頁數private $page; //當前頁private $config = array( 'head' => '條記錄', 'prev' => '上一頁',