Time of Update: 2016-07-25
實現php檔案安全下載! public function downloads($name){ $name_tmp = explode("_",$name); $type = $name_tmp[0]; $file_time = explode(".",$name_tmp[3]); $file_time = $file_time[0]; $file_date = date("Y/md",$file_time);
Time of Update: 2016-07-23
SimpleDao.class //require_once('FirePHPCore/FirePHP.class.php'); //$firephp = FirePHP::getInstance(true); // debugger in firefox class SimpleDao { private $_table = null; private static $_con = null; public
Time of Update: 2016-07-23
[PHP]代碼 /** php 產生二維碼名片* api Google* google api 二維碼產生【QRcode可以儲存最多4296個字母數字類型的任意文本,具體可以查看二維碼資料格式】* @param string $chl 二維碼包含的資訊,可以是數字、字元、二進位資訊、漢字。不能混合資料類型,資料必須經過UTF-8 URL-encoded.如果需要傳遞的資訊超過2K個位元組,請使用POST方式* @param int $widhtHeight 產生二維碼的尺寸設定*
Time of Update: 2016-07-23
//Form.php class form { var $layout=true;//是否使用表格版面配置 var $action;//表單要提交到的URL var $method; var $enctype=""; var $name=""; var $id=""; var $class=""; function
Time of Update: 2016-07-23
[PHP]代碼 class Db{protected $_connect;protected $_db = Array();protected $_cache = Array();public function __construct($args){list($this->_db,$this->_cache) = $args;}protected function connect($db){$this->_connect = mysql_connect($db['hostname'],
Time of Update: 2016-07-23
我們先來分析下規律。 設定總金額為10元,有N個人隨機領取: N=1 第一個 則紅包金額=X元; N=2 第二個 為保證第二個紅包可以正常發出,第一個紅包金額=0.01至9.99之間的某個隨機數。 第二個紅包=10-第一個紅包金額; N=3 第三個 紅包1=0.01至9.99之間的某個隨機數 紅包2=0.01至(10-紅包1-0.01)的某個隨機數 紅包3=10-紅包1-紅包2 ……
Time of Update: 2016-07-23
擷取訪問者IP地址 [PHP]代碼 static public function getip() { if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) { $ip = getenv("HTTP_CLIENT_IP"); } else if (getenv("HTTP_X_FORWARDED_FOR")
Time of Update: 2016-07-23
?//在URL後參加 ?pwd=密碼 查看產生密碼$password = '8baa717e6265d1c1d762cc896151f821'; //l23?> php ZIP壓縮程式 TOP 複製代碼php, zip
Time of Update: 2016-07-23
for ($start = 0; $start $url = "http://movie.douban.com/top250?start=$start&filter=&type="; $titles = parsePage($url); if ($titles === false) { echo $url, "\n"; } else { array_walk($titles, 'printTitle'); }} function
Time of Update: 2016-07-23
百度翻譯介面類/** * 百度開發人員中心:http://developer.baidu.com/ * 百度翻譯API:http://developer.baidu.com/wiki/index.php?title=docs */class baiduAPI{ /** * $from : 源語言語種:語言 * $to : 目標語言語種:語言代碼或auto */ static public function fanyi($value, $
Time of Update: 2016-07-23
建立控制器路徑:/controllers/demo.phpclass Demo extends IController{ public $layout = 'site'; function init() { CheckRights::checkUserRights(); } /** * 預設index方法 */ public function index() { // 調用Model //
Time of Update: 2016-07-23
基本代碼規範本篇規範制定了代碼基本元素的相關標準,以確保共用的php代碼間具有較高程度的技術互連性。關鍵詞 “必須”("MUST")、“一定不可/一定不能”("MUST NOT")、“需要”("REQUIRED")、“將會”("SHALL")、“不會”("SHALL NOT")、“應該”("SHOULD")、“不該”("SHOULD NOT")、“推薦”("RECOMMENDED")、“可以”("MAY")和”可選“("OPTIONAL")的詳細描述可參見 [RFC 2119][]
Time of Update: 2016-07-23
背景:安裝完redis之後,需要安裝phpredis擴充,才能讓php操作redis;本機有多個php版本,安裝過程中遇到的坑分享一下。一 下載git上下載redis的擴充包git clone https://github.com/nicolasff/phpredis複製代碼二 掛載和configure在shell中輸入 phpize 【注意:多個php版本的時候需要指定】 ./configure 複製代碼【phpize是用來擴充php擴充模組的,通過phpize可以建立php的外掛模組】注意:
Time of Update: 2016-07-23
當表單中有需要提交數組到資料庫,比如要加一些客服QQ的資訊,Laravel 會拋出輸入的欄位不能為數組的錯誤,解決辦法也很簡單。增加多個QQ客服需要用到數組拋出的錯誤ErrorException in helpers.php line 671:preg_replace(): Parameter mismatch, pattern is a string while replacement is an
Time of Update: 2016-07-23
首先你應該是在用 PHP 5.3 以上的版本,如果 PHP 版本在這之下,是時候該升級了。我建議如果有條件,最好使用最新的版本。你應該看過 PHP The Right Way,這篇文章包含了很多內容,而且還能再擴充開。大部分的名詞和概念你都需要瞭解。1. PSRThe idea behind the group is for project representatives to talk about the commonalities between our projects and find
Time of Update: 2016-07-23
本想直接繼續上執行個體,無奈怕一篇文章太長,還是先說點很基礎的關鍵點 我在學習Laravel5.1,雖然剛剛開始,認識很淺,但還是需要做做歸納,清晰認識建議大家到laravel學院學習laravel1、路由(app/routes.php)在routes.php中進行路由設定,;作為訪問的統一入口,是控制器的統一調度;沒有配置路由,就沒有正確地訪問路徑;路由需要自己規定一定的規則,方便自己查看、使用、理解;2、路由基本類型及使用樣本get
Time of Update: 2016-07-23
日誌介面規範本文制定了日誌類庫的通用介面規範。本規範的主要目的,是為了讓日誌類庫以簡單通用的方式,通過接收一個 Psr\Log\LoggerInterface 對象,來記錄日誌資訊。架構以及CMS內容管理系統如有需要,可以對此介面進行擴充,但需遵循本規範,這才能保證在使用第三方的類庫檔案時,日誌介面仍能正常對接。關鍵詞 “必須”("MUST")、“一定不可/一定不能”("MUST NOT")、“需要”("REQUIRED")、“將會”("SHALL")、“不會”("SHALL
Time of Update: 2016-07-23
(2016年最新更新)程式員之家廣告贊助合作說明
Time of Update: 2016-07-23
經過一段時間的錄製,現在Laravel 5.1的系列視頻已經錄製完成,嗯,免費,各位客官有興趣就看看1. Laravel 5基礎教程,免費觀看https://laravist.com/series/laravel-5-basic2. 還錄了一個Dingo/api的系列,完全講解開RESTful API的開發流程https://laravist.com/series/dive-into-restful-api-with-laravel3.
Time of Update: 2016-07-25
效果:今天是:星期五今天是:禮拜五2010-12-12是:禮拜日 [PHP]代碼 function getWeekName($data,$format = '星期'){ $week = date( "D ",$data); switch($week) { case "Mon ": $current = $format."一"; break; case "Tue ":