資料庫連接操作類

資料庫連接操作類 class mysql{private $_link;public function __construct($dbhost,$dbuser,$dbpassword,$dbname,$charset='utf8'){$this->_link = mysql_connect($dbhost,$dbuser,$dbpassword,true);

遍曆某檔案夾下的所有檔案和檔案夾方法三

遍曆某檔案夾下的所有檔案和檔案夾方 function list_dir($dirpath){if($dirpath[strlen($dirpath)]-1!='/'){$dirpath.="/";}static $result_array=array();if(is_dir($dirpath)){$files_dirs=scandir($dirpath);foreach(

遍曆某檔案夾下的所有檔案和檔案夾 方法六

遍曆某檔案夾下的所有檔案和檔案夾 function list_dir($dirpath){ if($dirpath[strlen($dirpath)-1]!="\\"){$dirpath.="\\";} static $result_array=array(); if(is_dir($dirpath)){

PHP操作檔案類

本類為檔案操作類,實現了檔案的建立,寫入,刪除,修改,複製,移動,建立目錄,刪除目錄 /***本類為檔案操作類,實現了檔案的建立,寫入,刪除,修改,複製,移動,建立目錄,刪除目錄* 列出目錄裡的檔案等功能,路徑後面別忘了加"/"* * @author 路人郝* @copyright myself* @link www.phpr.cn* */class

判斷輸入是否是純數字,英文,漢字等

利用php的mb_strlen和strlen函數就可以輕鬆得知字串的構成 是全英文、英漢混合、還是純漢字。簡要說明如下(以上樣本程式) 1、如果strlen返回的字元長度和mb_strlen以當前編碼計算的長度一 致,可以判斷是純英文字串。 2、如果strlen返回的字元長度和mb_strlen以當前編碼計算的長度不一致, 且strlen傳回值同mb_strlen的傳回值求餘後得0可以判斷為是全漢字的字串。

能把漢字轉化為拼音的一個函數

能把漢字轉化為拼音的一個函數 $d=

遍曆某檔案夾下的所有檔案和檔案夾 方法五

遍曆某檔案夾下的所有檔案和檔案夾 function list_dir($dirpath){ if($dirpath[strlen($dirpath)-1]!="\\"){$dirpath.="\\";} static $result_array=array(); if(is_dir($dirpath)){ $handle=opendir($dirpath); while(

遍曆某檔案夾下的所有檔案和檔案夾方法四

遍曆某檔案夾下的所有檔案和檔案夾 function list_dir($dirpath){ if($dirpath[strlen($dirpath)-1]!="\\"){$dirpath.="\\";} static $result_array=array(); if(is_dir($dirpath)){

擷取頁面內容的一個函數

擷取頁面內容的一個函數 function getwebdate($url){ $tmp = str_replace('http://', '', $url); $domain = substr($tmp, 0, strpos($tmp, '/')); $path = strstr($tmp, '/'); $fp =

判斷訪問IP

判斷訪問IP function getIP() { if (! empty ( $_SERVER ["HTTP_CLIENT_IP"] )) { $cip = $_SERVER ["HTTP_CLIENT_IP"]; } else if (! empty ( $_SERVER ["HTTP_X_FORWARDED_FOR"] )) { $cip = $_SERVER ["

PHP 的 session_encode() 和 session_decode() 函數

//boolean session_encode()session_register ( 'bgcolor' );session_register ( 'fontcolor' );$id = session_id ( $usr_id );$bgcolor = "white";$fontcolor = "blue";$usr_data = session_encode ();print $usr_data;?>複製代碼

根據資料庫中的檔案記錄來刪除檔案

判斷資料庫中的欄位與檔案夾中的檔案是否對應,如果沒有對應則刪除檔案,極大的減少了佔用系統資源。 //Created on 2010-4-24 Made by Wolf QQ116311316 //作用:是判斷資料庫中的欄位與檔案夾中的檔案是否對應,如果沒有對應//則刪除檔案,極大的減少了佔用系統資源。 //$dir 是要尋找的檔案目錄 //$table 為尋找的表 //$

Zend Framework上傳檔案重新命名

//執行個體化檔案上專類$fName=$this->_request->getPost('fName');$adapter = new Zend_File_Transfer_Adapter_Http();//存放上傳檔案的檔案夾$adapter->setDestination('/opt/lampp/htdocs/blog/upload');//上傳配置$adapter->addValidator ( 'Extension', false,

刪除檔案以及對應的檔案夾

刪除目錄及所包含檔案函數 //注意 $dir檔案名稱 eg:admin/runtime //刪除目錄及所包含檔案函數 function deldir($dir) { //開啟檔案目錄 $dh = opendir($dir); //迴圈讀取檔案 while ($file = readdir($dh)) {

PHP 使用 session_destroy() 刪除 Session 資料

session_start () ; session_register ( "A" ) ; session_register ( "B" ) ; session_register ( "C" ) ; $A = "AAA"; $B = "BBB"; $C = "CCC"; $result = session_destroy () ; if ($result=1) { echo "The session is destroyed! " , "\n " ; } else

餅圖產生類及樣本

根據傳入參數自動產生餅圖。 /* * 產生餅形圖片 */class PieChart { private $center; //餅形中點 private $width; //餅形直徑 private $image; //繪圖物件 function __construct($width,$backcolor =

PHP 用 tidy_parse_file() 函數提取 HTML 中的連結

function dump_urls(tidy_node $node, &$urls = NULL) { $urls = (is_array($urls)) ? $urls : array(); if(isset($node->id)) { if($node->id == TIDY_TAG_A) { $urls[] = $node->attribute['href'];

【PHP】基於 Cookie 的登入和身份認證

Enter Password 複製代碼 $now = getdate(); $storetime= $now["weekday"] . " " . $now["month"] ." " . $now["year"] ; $storetime.=" Time : "; if ($now["hours"]

再次提供一個IP地理位置查詢類

IP 地理位置查詢類 /** 檔案名稱:IpLocation.class.php* IP 地理位置查詢類 (主檔案我上傳上來了 還有一個測試檔案我上傳上來,同時還有一個QQWry.Dat這個大家可以在純真IP庫下載到 因為有6M多 所以這裡不上傳上來了)* * @author 馬秉堯 * @version 1.5 * @copyright 2005

share一段採集程式的代碼

看到總有人問curl的問題,這兩天沒事寫了個採集論壇的小程式。裡麵包括了類比登陸,擷取頁面原始碼,正則匹配結果等部分,希望對大家有用。 set_time_limit(0);//cookie儲存目錄$cookie_jar = '/tmp/cookie.tmp';/*函數-----------------------------------------------------

總頁數: 5203 1 .... 1519 1520 1521 1522 1523 .... 5203 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.