原创 COPY一個目錄底下所有文件的函數

//copy dir function full_copy($source, $target, $exclude = array()) { //print "Copying " . $source ."\n"; if (is_dir

原创 PHP執行過程中的log

function Dmess($msg, $prefix='') { $debugMethod = 1;// 0-> print out stnd; 1-> write log file; $traceArr = debu

原创 獲得包含某個時間的範圍的函數

得到小時的起止時間function getHourRange($date){ $ret=array(); $timestamp=strtotime($date); $ret['sdate']=date('Y-m-d H:00:00

原创 easyeclipse配色方案下載

http://eclipsecolorthemes.org/

原创 windows下批量刪除svn文件

@echo on color 2f mode con: cols=80 lines=25 @REM @echo delete svn...... @rem ..... @rem for /r . %%a in (.) do @if exi

原创 mysql中select * for update鎖表的問題

先前介紹過SELECT ... FOR UPDATE的用法,不過鎖定(Lock)的資料是判別就得要注意一下了。由於InnoDB預設是Row-Level Lock,所以只有「明確」的指定主鍵,MySQL纔會執行Row lock (只鎖住被選

原创 php創建目錄

function makeDir($param) { if(!file_exists($param)) { makeDir(dirname($param)); mkdir($param); } }

原创 使用ajax上傳文件

$("#upload_img").live('change',function(){ var formobj = document.getElementById("add_img"); var fo

原创 保存web文件

function saveFileFromWeb($http_url , $save_file_path, $MediaType) { $download_info = load_remote_file($http_url, $sav

原创 MySQL中grant命令詳解

本文實例,運行於 MySQL 5.0 及以上版本。 MySQL 賦予用戶權限命令的簡單格式可概括爲: grant 權限 on 數據庫對象 to 用戶 一、grant 普通數據用戶,查詢、插入、更新、刪除 數據庫中所有表數據的權

原创 關於window下使用git管理php源碼的環境配置問題

嘗試了一些集成git的php開發工具感覺安裝起來都很複雜,最終選擇了phpstorm,大家如果有更好的工具希望能交流一下, 安裝phpstorm 建議到官網下載  地址:http://www.jetbrains.com/phpstorm

原创 windows下memcache配置以及php的相關配置

Windows下Memcached的安裝與配置 下載memcache的windows穩定版,解壓放某個盤下面,比如在c:\memcached 在終端(也即cmd命令界面)下輸入 ‘c:\memcached\memcached.exe -d

原创 html5上傳文件和html4上傳文件的區別

if( isset($_SERVER['HTTP_CONTENT_DISPOSITION'])&&preg_match('/attachment;\s+name="(.+?)";\s+filename="(.+?)"/i',$_SERVE

原创 CI中如何去掉index.php

CI中去掉index.php apache中僞靜態的配置 RewriteEngine on RewriteBase /test RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*

原创 天氣預報接口

中國天氣網(weather.com) 【該接口如果用js直接調用會出現跨域問題,可以以自己的服務器作爲跳板,js請求自己的服務器,自己的服務器(例如:PHP)再去請求該接口】 http://m.weather.com.cn/data/1