原创 高效率的PHP優化準則

原文連接:http://www.sjlives.com/archives/644 少用正則表達式 str_replace 函數要比 preg_replace 快得多,strtr 函數又比 str_replace 來得快。 strpbrk

原创 令人困惑的strtotime

今天是2018-07-31 執行代碼: date("Y-m-d",strtotime("-1 month"))  怎麼輸出是2018-07-01? 我們來模擬下date內部的對於這種事情的處理邏輯: 1. 先做-1 month, 那麼

原创 自動創建用戶目錄 防止相同文件覆蓋

<?php $author=$_POST["author"]; $introduce=$_POST["introduce"]; echo $_FILES["filename"]["size"]; if($_FILES["filen

原创 往github上傳代碼

http://www.cnblogs.com/cxk1995/p/5800196.html

原创 VPS中shadowsock配置服務器

VPS:在搬瓦工上買的,系統Ubuntu 16#服務端:安裝shadowsockssudo apt-get updatesudo apt-get install python-pipsudo apt-get install python-

原创 Ajax 請求太頻繁

服務器做了兩個優化 CPU 使用率減低 40% 解決方案 核心思路是不論瀏覽器打開了多少窗口,瀏覽器內的所有窗口在單位時間內(15 秒),只能發送一個請求。怎麼做到呢?利用現代瀏覽器內置的 localStorage 功能可以很容易實現:

原创 php獲取本週一,本週日,上週一,上週日,本月一日,本月最後一日,上月一日,上月最後一日日期

//本週一 echo date('Y-m-d', (time() - ((date('w') == 0 ? 7 : date('w')) - 1) * 24 * 3600)); //w爲星期幾的數字形式,這裏0爲週日 //本週日 ech

原创 TP5.1使用 GatewayWorker 進行 socket 通訊

1.安裝 Workerman    composer 安裝GatewayWorker內核文件(不包含start_gateway.php start_businessworker.php等啓動入口文件) composer require

原创 redis集羣

https://www.cnblogs.com/wuxl360/p/5920330.html

原创 play_videojs

vue + videojs:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=

原创 mongodb 安裝配置(linux/windows)

 windows上出現的錯誤:  D:\MongoDB\bin>mongo.exe --dbpath d:\data\db  Error parsing command line: unrecongised option '--dbpat

原创 cuplayer

酷播播放器:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">

原创 ubuntu安裝svn服務器

 contos SVN 環境搭建配置跟自動部署 ubuntu安裝svn服務器: apt-get install subversion 安裝完畢後可以用 下邊的命令查看是否安裝完成,如果現實出版本號和版權信息等等就證明安裝完成。 s

原创 正則表達式

1 . 校驗密碼強度 (密碼的強度必須是包含大小寫字母和數字的組合,不能使用特殊字符,長度在8-10之間。) "/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$/" 1 . php去除特殊字符和

原创 TP5.+的擴展

安裝驗證碼擴展包: composer require topthink/think-captcha 在模板裏可以正常使用驗證碼了,模板裏輸出驗證碼 <div>{:captcha_img()}</div> 或者 <div