Time of Update: 2016-07-25
擷取訪問者作業系統 function osinfo() { $os=""; $Agent = $GLOBALS["HTTP_USER_AGENT"]; if (eregi('win',$Agent) && strpos($Agent, '95')) { //OsPHP.COM.CN $os="Windows 95"; } elseif (eregi('win 9x',$
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
/** 擷取機器網卡的物理(MAC)地址 **/ class GetMacAddr { var $return_array = array(); // 返回帶有MAC地址的字串數組 var $mac_addr; function GetMacAddr($os_type)
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
詳細內容可以參考 周小蛇的秘密花園 ---- PHP手寫方法之 過濾HTML字元 http://zhousir.net/php-html-filtering-method-handwritten-characters.html function html2text($str){$str=trim($str);$str = preg_replace("/||/isU"
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
函數列表: convert_cyr_string() crc32() hebrev() hebrevc() money_format() number_format() echo convert_cyr_string('The string', 'k','i');複製代碼
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 =
Time of Update: 2016-07-25
調試bug 請通知本人,謝謝! 新版功能: 1. 添加{-script lang='php'-} 模板也可以寫php代碼 2.修改1.0 細節錯誤 : 如無用功代碼,最佳化核心代碼,提高運行編譯速度。 3.添加模板格式化函數{-$string|subistr(12):'...'-} ,時間格式化 {-$time|time('ymd')-} /** *