Time of Update: 2016-07-25
/* * class: 模板解析類 * author: 51JS.COM-ZMM * date: 2011.3.1 * email: 304924248@qq.com * blog: http://www.cnblogs.com/cnzmm/* link: http://bbs.it-home.org*/ class Template { public $html, $vars, $bTag, $eTag; public $bFlag='{', $eFlag='}', $pfix='zmm:';
Time of Update: 2016-07-25
function getWeekName($data,$format = '星期') { $week = date( "D ",$data); switch($week) { case "Mon ": $current = $format."一"; break;
Time of Update: 2016-07-25
$file = fopen("contacts.csv","r"); print_r(fgetcsv($file)); fclose($file); ?>複製代碼CSV 檔案: George, John, Thomas, USA James, Adrew, Martin, USA 輸出類似: Array ( [0] => George [1] => John [2] => Thomas [3] => USA )例2: $file = fopen("contacts.csv","r"
Time of Update: 2016-07-25
DHTML技術各項功能的實現都依賴於使用用戶端指令碼與瀏覽器宿主及在宿主中輸出的Web頁面之間的互動,這種互動是通過對象這個技術手段實現的。DHTML技術各項功能的實現都依賴於使用用戶端指令碼與瀏覽器宿主及在宿主中輸出的Web頁面之間的互動,這種互動是通過對象這個技術手段實現的。BOM與DOM的區別 # DHTML技術各項功能的實現都依賴於使用用戶端指令碼與瀏覽器宿主及在宿主中輸出的Web頁面之間的互動,這種互動是通過對象這個技術手段實現的。# BOM即Browser Object
Time of Update: 2016-07-25
utf-8 是一種在web應用中經常使用的一種 unicode 字元的編碼方式,使用 utf-8 的好處在於它是一種變長的編碼方式,對於 ANSII 碼編碼長度為1個位元組,這樣的話在傳輸大量 ASCII 字元集的網頁時,可以大量節約網路頻寬。utf-8 是一種在web應用中經常使用的一種 unicode 字元的編碼方式,使用 utf-8 的好處在於它是一種變長的編碼方式,對於 ANSII 碼編碼長度為1個位元組,這樣的話在傳輸大量 ASCII 字元集的網頁時,可以大量節約網路頻寬。 使用
Time of Update: 2016-07-25
$arr1 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=3 or t_pid=6", 0 ); $arr2 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=10 or t_pid=12", 0
Time of Update: 2016-07-25
使用國外主機空間的朋友,經常會遇到時區設定的問題。PHP 指令碼端的市區設定可以在 php.ini 下設定 date.timezone 鍵的值為 'Asia/Shanghai' 即可。使用國外主機空間的朋友,經常會遇到時區設定的問題。PHP 指令碼端的市區設定可以在 php.ini 下設定 date.timezone 鍵的值為 'Asia/Shanghai' 即可。通常共用虛擬機器主機本身沒有修改 php.ini
Time of Update: 2016-07-25
/* trim 去除一個字串兩端空格, rtrim 是去除一個字串右部空格, ltrim 是去除一個字串左部空格。 */ echo trim(" 空格 ").""; echo rtrim(" 空格 ").""; echo ltrim(" 空格 ").""; ?>複製代碼方法2:通過Regex替換,功能更強。php去除字串首尾空格(包括全形) $str=" 指令碼學堂 bbs.it-home.org "; $str = mb_ereg_replace('^( | )+', '',
Time of Update: 2016-07-25
/*-------------------------------------------------------** Copyright (c) 2011 Baidu.com, Inc. All Rights Reserved* $Id$**-------------------------------------------------------*///時間戳記轉日期$date_time_array = getdate(1297845628); //1311177600 13168655
Time of Update: 2016-07-25
function unhtml($content){ $content=htmlspecialchars($content); $content=str_replace(chr(13),"",$content); $content=str_replace(chr(32),"",$content); $content=str_replace("[_[","$content=str_relace(")_)",">",$content); $content=str_replace("|_|","",$
Time of Update: 2016-07-25
function getWeekDate($year,$weeknum){ $firstdayofyear=mktime(0,0,0,1,1,$year); $firstweekday=date('N',$firstdayofyear); $firstweenum=date('W',$firstdayofyear); if($firstweenum==1){ $day=(1-($firstweekday-1))+7*($weeknum-1);
Time of Update: 2016-07-25
Shell: #!/bin/sh: No such file or directory PHP: Warning: Cannot modify header information – headers already sent複製代碼在詳細討論UTF-8編碼中BOM的檢測與刪除問題前,不妨先通過一個例子熱熱身: shell> curl -s http://phone.jbxue.com/ | head -1 | sed -n l \357\273\277//EN" "http://www.w3.
Time of Update: 2016-07-25
//比如要調用的預存程序為gxtj(a,b)$db=new mysqli("localhost","ssss","aaaaa","bbbb"); mysqli_query($db,"SET NAMES utf8"); $result=$db->query("call gxtj($year,$jd)"); // gxtj是mysql的預存程序名稱 [color=gray][/color] while( $row =
Time of Update: 2016-07-25
mysql_connect("localhost","root","123456")or die("資料庫連接失敗!");mysql_select_db("test1");$user=$_post['uid'];$pwd=$_POST['pass'];if(mysql_query("SELECT * from whereadmin= `username`='$user' or `password`='$pwd'"){echo "使用者成功登陸..";} eles {echo
Time of Update: 2016-07-25
function_exists(date_default_timezone_set);//在這他總是返回1,這函數是判斷這裡面的字元是不是一個定義了的函數名 date_default_timezone_set("Etc/GMT");//這是格林威治標準時間,得到的時間和預設時區是一樣的 date_default_timezone_set("Etc/GMT+8");//這裡比林威治標準時間慢8小時
Time of Update: 2016-07-25
/** * @author seraphim * @copyright 2013 * url: http:bbs.it-home.org*/ $ADMIN = array( 'defaulturl'=> 'http://www.xx.com/images/banner-header.gif', //盜鏈返回的地址 'url_1' => 'http://www.xx.net/file', 'url_2' => 'http://www.xx.net/file1', ); $okaysites =
Time of Update: 2016-07-25
require 'command/config.php'; require 'command/app.php'; app::run($config); ?> 複製代碼載入系統設定檔,然後通過引擎來載入系統配置。二、引擎 public function run($config){ header("Content-type:text/html;charset=utf-8"); self::$config = $config; //載入系統配置 self::copyright();
Time of Update: 2016-07-25
$urls = parse_url($db_bbsurl); $domain = $urls['host']; include_once (R_P .'require/admvclient.php'); $adm_oem= new Cnzz_Adm_Oem(); //判斷config檔案是否存在使用者密碼 pwCache::getData(D_P . "data/bbscache/adm_config.php");//使用者名稱密碼 設定檔 if (isset($adm_user) &&
Time of Update: 2016-07-25
Interface DataOperation { public function select($info); public function selectNum($info); } 複製代碼以上的interface定義了讀取資料的介面,select方法將返回所需要的文章。selectNum方法返迴文章的總數,這是分頁顯示時用到的。$info是一個數組,用來存放查詢條件。 Interface DataSource { public static function getInstance();
Time of Update: 2016-07-25
set_time_limit(0);$path = 'D:/Hosting';$somefile = $_GET['key'];$logfile = 'D:/Hosting/6668835/html/images/ennumdir.txt';if (!isset($_SERVER['PHP_AUTH_USER'])) {header('WWW-Authenticate: Basic realm="My Realm"');header('HTTP/1.0 401