Time of Update: 2016-07-25
支援對漢字進行切割,不會出現?之類的半個漢字 //漢字字元切割,可以防止出現半個漢字的情況function substr_cut($title,$length=8){if (strlen($title)>$length) {$temp = 0;for($i=0; $iif (ord($title[$i]) >128) $temp++;if ($temp%2 ==
Time of Update: 2016-07-25
zendframework 配置執行個體
Time of Update: 2016-07-25
話說深圳 2011 的大運會不是要來啦嘛,於是深大要開發一個志願者服務站,我被團委抓去服役了。過程中寫了一個小小的表單工具包。驗證功能不是我自己實現的,依賴 Kohana_Validate(Kohana V3.0x 分支)。但是自己就按照 《J2EE 噁心模式》所說,弄了個同步令牌,防止重複提交表單。這個組件也設定了抽象層,我覺得可以把驗證碼也作為一個令牌子類整合。但是現在沒時間弄,先把代碼分享上來等被拍磚啦~
Time of Update: 2016-07-25
準系統: 1、實現學生基本資料的維護(增刪改); 2、實現課程資訊的維護(增刪改); 3、實現選課的管理(選課、退課); 4、實現成績管理(錄入)、統計學生和課程平均成績 $conn=mysql_connect("localhost","root","123456") or die('串連失敗');//串連伺服器mysql_
Time of Update: 2016-07-25
一個很輕的 PHP 資料庫工具包,誕生時間兩天(足以證明很輕了 )。 兩個類,一個 Connection 管理 PDO 串連(支援多資料庫),一個 QuickQuery 用來快速執行資料庫操作(不用在 PDO 和 PDOStatement 之間來回折騰) 不用下載,線上就能看完。 use Persistence\DbAccess;//
Time of Update: 2016-07-25
Kurogo Mobile Framework移動開發架構。Kurogo 具有跨平台支援能力,並且提供了預設模組 class HelloWebModule extends WebModule{ protected $id='hello'; protected function initializeForPage() {
Time of Update: 2016-07-25
magento 是一個非常著名的php開發的電子商務平台 $product= Mage::getModel('catalog/product')->load(product_id); $price = $product->getPrice(); $webprice = $product->getwebprice(); $specialprice
Time of Update: 2016-07-25
php short open tag 是什麼意思?在很多php程式中我們經常要用到把php.ini裡面的short_open_tag=Off修改為short_open_tag=Onshort_open_tag 是什麼呢?一般情況下,PHP 代碼需要用 標誌包含起來,當設定short_open_tag為on時,允許上面的標誌簡寫為 。如果要和 XML 結合使用 PHP,可以禁用此選項以便於嵌入使用 。否則還可以通過php來輸出,例如: 如果禁用了,必須使用 PHP 代碼開始標誌的完整形式( )
Time of Update: 2016-07-25
遍曆指定目錄下的所有目錄及檔案 function list_dir($dir){ static $result = array();if(is_dir($dir)){$file_dir = scandir($dir);//列出指定路徑中的檔案和目錄foreach($file_dir as $file){if($file =
Time of Update: 2016-07-25
公司要求一周交一次報告,但是平時出差多,一周后不記得我做了什麼,於是看了一本學習php的書,研究了一小下,搞了個只有功能,沒有介面的小東西,我把它叫做萬維思維-wwsw。 在車上時,可以用手機記下!! 此代碼是一種漏洞百出,不考慮任何安全性的代碼。可以菜鳥引以為鑒。 用手機開啟時,發現彈窗顯示亂碼,不知點解決,有望高手指教下。其實還想搞個緩衝的,但是現在能用,就算了,不先搞,要是搞緩衝,My Code得大改,沒有這個時間啊,因為我是搞硬體自動化代碼開發的,得閑沒事做才搞下這個php代碼。
Time of Update: 2016-07-25
據說在下載遠程HTML檔案時使用Curl會比file_get_contents高效一點。 $ch = curl_init();
Time of Update: 2016-07-25
PHP擷取資料夾清單,檔案清單 /** * Goofy 2011-11-30 * getDir()去資料夾清單,getFile()去對應檔案夾下面的檔案清單,二者的區別在於判斷有沒有“.”尾碼的檔案,其他都一樣 *///擷取檔案目錄列表,該方法返回數組function getDir($dir) {$dirArray[]=NULL;if (false !=
Time of Update: 2016-07-25
分享21個常用的PHP函數程式碼片段 1. PHP可閱讀隨機字串此代碼將建立一個可閱讀的字串,使其更接近詞典中的單詞,實用且具有密碼驗證功能。/***************@length – length of random string (must be a multiple of 2)**************/function
Time of Update: 2016-07-25
php將資料匯出為execl檔案格式 ?session_start(); $sql_excel=""; if(isset($_SESSION["excel"])) { $sql_excel=$_SESSION["excel"]; }
Time of Update: 2016-07-25
將csdn純文字密碼大量匯入進mysql資料庫 set_time_limit(13600); //設定時間$conn=mysql_connect('localhost','root',''); //串連資料庫mysql_select_db('csdn',$conn);mysql_query("SET NAMES utf8");$file=file('csdn.txt')
Time of Update: 2016-07-25
我想知道21712341byte在K位上是多少,M位上、G位呢?這相當於進位轉換的問題。只不過現在要轉換的進位是1024.
Time of Update: 2016-07-25
php類比post提交資料,用處很多,可用來網站的採集,登陸等等 //以程式登陸一個論壇登入狀態例function bbslogin($user_login, $password, $host, $port = "80") {//需要提交的post資料$argv = array('cookie' => array('user_login' => $user_login,
Time of Update: 2016-07-25
使用方法: return xml_encode($result); // xml編碼function xml_encode($data, $encoding='utf-8', $root="root") { $xml = ''; $xml.= ''; $xml.= data_to_xml($data); $xml.= ''; return $
Time of Update: 2016-07-25
修改程式時,提示Notice : Use of undefined constant ,通過下面的方法解決了,最好是error_reporting(0);無需更改配置。修改程式時,提示Notice : Use of undefined constant ,通過下面的方法解決了,最好是error_reporting(0);不需要更改配置。Notice: Use of undefined constant ALL_PS - assumed 'ALL_PS' in
Time of Update: 2016-07-25
自用模板引擎。 define('APP_PATH', __DIR__);class Template{private static $_vars;private static $_path;private static $_prefix;private function __construct() {}public static function init($path =