Time of Update: 2016-07-28
本文執行個體講述了PHPExcel合并與拆分儲存格的方法。分享給大家供大家參考,具體如下:$objPHPExcel;$filepath="c:\temp.xlsx";try { $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $objPHPExcel = $objReader->load($filepath);} catch (Exception $e) { die();}$column_index =
Time of Update: 2016-07-28
本文執行個體講述了php實現大量刪除掛馬檔案及批量替換頁面內容的方法。分享給大家供大家參考,具體如下:read())) { if($v == "." || $v == "..") continue; $file = $d->path."/".$v; if(is_dir($file)) { echo "$v"; hx_dirtree($file); }else{ $ext=substr(strrchr($v,"."), 1); if( in_array($ext ,
Time of Update: 2016-07-28
本文執行個體為大家分享了PHP檔案多伺服器同步工具,具體內容如下 $v){ if(strlen($v) array('strwei.com','FTP使用者名稱','FTP密碼', '開啟FTP進去時的預設目錄'),//ftp地址、使用者名稱,密碼、FTP開啟此網站時的預設目錄 //'server2' => array('yy.9.je','FTP使用者名稱','FTP密碼','開啟FTP進去時的預設目錄'), ); $aAbortFile =
Time of Update: 2016-07-28
ubuntu和debain下的apt方式安裝軟體很方便,特別是對於新手安裝和卸載nginx。 由於nginx不能動態添加模組,所以會經常安裝和卸載、升級。apt安裝nginx方法sudo apt-add-repository ppa:nginx/developmentsudo apt-get updatesudo apt-get install nginxapt卸載nginx方法卸載方法1. 刪除nginx,保留設定檔sudo apt-get remove nginx刪除設定檔rm -rf
Time of Update: 2016-07-28
1.首先下載的demo,一般都是有些bug的,先要改一下。2.貌似沒有為服務商模式單獨開發demo,下載的也都是普通商戶的支付demo,其實這裡沒有必要單獨寫,因為他們區別就是幾個參數的區別。(0)demo裡設定的參數全部都要填服務商的,而不是子商戶的。(1)第一個區別是openid,demo裡直接傳的openid,服務商模式需要傳sub_openid,擷取的方式就不說明了,總之擷取所需都是子商戶即特約商戶的appid,appsecret。(2)需要在傳入頁面多傳一個sub_mch
Time of Update: 2016-07-28
我們的培訓是app開發整套的課程更多是基礎 、js、php、Mysql,從UI的設計到手機底層到背景開發到資料庫的管理,從一個創意的萌生到APP的上架,就算是0基礎的學員也能夠輕鬆開發出屬於自己的APP,我們培訓的是能夠獨立開發app的全棧工程師!東翌學院是專註跨平台APP開發線上培訓機構,課程覆蓋javascript,php,ios,html5,html,css等課程,適合零基礎和有基礎進修的同學學習,
Time of Update: 2016-07-28
yum install phpredis -y如果使用Centos內建php則確保php-devel安裝 否則執行:yum install php-devel -y (不安裝的話無法載入redis擴充)串連到Redis伺服器//Connecting to Redis server on localhost redis=newRedis();redis->connect(‘127.0.0.1’, 6379); result=redis->auth(password);//密碼登陸
Time of Update: 2016-07-28
server { listen80; server_name 192.168.33.10 dev.me; root /var/www/html; indexindex.php index.html; client_max_body_size 25M; error_log /var/log/nginx/error.log; access_log /var/log/nginx/access.log; location / { if (!-
Time of Update: 2016-07-28
原因:php5.5以後的preg_replace不再支援e模式修飾符,可以用preg_replace_callback函數替換。解決辦法:找到檔案 Smarty_Compiler.class.php 第270行:/* replace special blocks by "{php}" */$source_content= preg_replace($search.'e', "'".$this->_quote_replace($this->left_delimiter) .'php'."' .
Time of Update: 2016-07-28
1.Accept屬於要求標頭, Content-Type屬於實體頭。 Http前序分為通用前序,請求前序,響應前序和實體前序。 請求方的http前序結構:通用前序|請求前序|實體前序 回應程式的http前序結構:通用前序|響應前序|實體前序2.Accept代表發送端(用戶端)希望接受的資料類型。 比如:Accept:text/xml; 代表用戶端希望接受的資料類型是xml類型Content-Type代表發送端(用戶端|伺服器)發送的實體資料的資料類型。 比如:Content-Type:text/
Time of Update: 2016-07-28
建立FileUtil.php檔案,內容及調用方式如下:php/** * 操縱檔案類 * * 例子: * FileUtil::createDir('a/1/2/3'); 測試建立檔案夾 建一個a/1/2/3檔案夾 * FileUtil::createFile('b/1/2/3'); 測試建立檔案 在b/1/2/檔案夾下面建一個3檔案 * FileUtil::createFile('b/1/2/3.exe')
Time of Update: 2016-07-28
1、輪詢(預設)每個請求按時間順序逐一分配到不同的後端伺服器,如果後端伺服器down掉,能自動剔除。2、weight指定輪詢幾率,weight和訪問比率成正比,用於後端伺服器效能不均的情況。例如:複製代碼 代碼如下:upstream backend {server 192.168.0.14 weight=10;server 192.168.0.15
Time of Update: 2016-07-28
前提: 關於 openresty 或者 ngx_lua 請參考:http://openresty.org/en/問題:
Time of Update: 2016-07-28
由於nginx依賴於pcre和zlib,所以在安裝nginx時,需要先安裝pcre和zlib(為了方便起見,我把pcre、zlib、nginx的包放到了同一個目錄下)。1、安裝pcre從pcre的官網下載tar.gz包,官網地址為:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/,在這裡我下載的是:pcre-8.39.tar.gztar -zxvf pcre-8.39.tar.gzcd pcre-8.39./configure
Time of Update: 2016-07-28
背景nginx服務配置和使用流程說明採用http://openresty.org/cn/getting-started.html的方式發起服務的話。 其中使用的命令為: PATH=/usr/local/openresty/nginx/sbin:$PATH export PATH Then we start the nginx server with our config file this way: nginx -p pwd/ -c conf/nginx.conf
Time of Update: 2016-07-28
$url="www.baidu.com"; //網域名稱$path="/"; //路徑$type="GET"; //要求方法error_reporting(E_ALL);echo "TCP/IP Connection\n";/* 擷取連接埠號碼 */$service_port = getservbyname('www', 'tcp');/* 擷取ip地址. */$address = gethostbyname($url);/* 建立 TCP/IP socket. */$socket =
Time of Update: 2016-07-28
今天要用到php的curl擴充,將php.ini中的;extension=php_curl.dll的注釋去掉後,重啟apache後仍然報Call to undefined function
Time of Update: 2016-07-28
error_reporting(E_ALL);ini_set("display_errors", 1);伺服器設定了錯誤不提示,因此PHP文法出現問題會提示錯誤500,解決辦法也很簡單, 將錯誤資訊顯示出來, 將如上代碼貼到檔案頂部即可。').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering);
Time of Update: 2016-07-28
find()ThinkPHP find() 方法是和 select() 用法類似的一個方法,不同之處 find() 查詢出來的始終只有一條資料,即系統自動加上了 LIMIT 1 限制。當確認查詢的資料記錄只能是一條記錄時,建議使用 find() 方法查詢,如使用者登入帳號檢測:public function chekUser(){ header("Content-Type:text/html; charset=utf-8"); $Dao = M("User");
Time of Update: 2016-07-28
單鏈表是一種鏈式存取的資料結構,用一組地址任意的儲存單元存放線性表中的資料元素。單鏈表簡介鏈表中的資料是以結點來表示的,每個結點的構成:元素(資料元素的映象) + 指標(指示後繼元素儲存位置),元素就是儲存資料的儲存單元,指標就是串連每個結點的地址資料。關鍵代碼如下所示:id = $id;$this->name = $name;}static public function show ($head){$cur = $head;while ($cur->next) {echo