Time of Update: 2016-07-20
除去字串中的重複詞,產生索引字串 //-------------------------------------------------- function GetIndexText($okstr,$ilen=-1) { if($okstr=="") return ""; $ws = explode(" ",$okstr); $okstr = ""; $wks = ""; foreach($ws as $w) { $w = trim($w);
Time of Update: 2016-07-20
class show_page { /** * 頁面輸出結果 * * @var string */ var $output; /** * 使用該類的檔案,預設為 PHP_SELF * * @var string */ var $file; /** * 頁數傳遞變數,預設為 'p' * * @var string */ var $pvar = "p"; /** *
Time of Update: 2016-07-20
完整郵件發送類class smtp{/* Public Variables */var $smtp_port;var $time_out;var $host_name;var $log_file;var $relay_host;var $debug;var $auth;var $user;var $pass;/* Private Variables */ var $sock;/* Constractor */function smtp($relay_host = "", $smtp_port =
Time of Update: 2016-07-20
php 為圖片加浮水印函數和縮圖的函數代碼/*** 為圖片加浮水印* @param string $desImg 靶心圖表片 參數格式為 ./images/pic.jpg* @param string $waterImg 浮水印圖片 參數格式同上,浮水印圖片為 png格式,背景透明* @param int positon 浮水印位置 1:頂部居左 2:頂部居右 3:置中 4 :底部居左 5:底部居右* @param bool $saveas 是否另存新檔,預設值false,表示覆蓋原圖*
Time of Update: 2016-07-20
function getPageRange($currentPage, $totalPages, $displaySize = 10) { if ($totalPages return array(); } elseif ($displaySize > $totalPages) { $startPage = 1; $endPage = $totalPages; } else { if ($currentPage %
Time of Update: 2016-07-20
php google api 介面程式php google api 介面程式這裡是一個完全funtional類產生Google地圖。 允許多類定製,使使用者能夠快速實現在幾分鐘之內就沒有任何網站的JavaScript或Google地圖Google地圖API的知識。class phproogleMap {/** @The google api key*/private $apiKey ;/** @the map zoom level*/private $mapZoom = 8 ;/** @The
Time of Update: 2016-07-20
添加附件添加一個附件添加一或多個附件很簡單,添加附件,是通過調用addAttachment方法,這種方法可以多次調用添加多個attachemnts。布爾addAttachment($檔案的字串,字串[$ c_type ='應用程式/八位位元組流'],串[$名稱=],布爾[$ isfile =真],字串[$編碼='一個base64'])變數:$檔案:要麼變數包含一個檔案的內容,或檔案本身的路徑$ c_type:內容類型,這意味著,例如檔案的MIME類型。 text / plain的,文字/
Time of Update: 2016-07-20
php實現多線程伺服器發送多個請求要實現多進程要方便很多。只能使用在cli模式。可以用在特殊場合,如郵件發送任務等。資源的共用訪問使用了檔案鎖,並不是很可靠,主要是為了能夠在Windwos下使用,如果確實有必要可以考慮自己改用相應的號誌機制(這個擴充只能用於xUNIX)。執行個體[php]define('DIR_PHP_EXEC', 'php');define('DIR_MAIN_EXEC', __FILE__);define('DIR_TMP',
Time of Update: 2016-07-20
php 將文字檔轉換csv輸出php 將文字檔轉換csv輸出這個類提供了轉換成固定寬度的CSV檔案,快速,簡便的方法。 它可將SplFileObject用於執行迭代,使它非常高效的一個迭代只知道當前成員。期權是提供給指定行字元和欄位分隔符號結束。 This from CSV files.這個類是特別有用的,如果資料需要來自一個固定寬度的檔案,並插入到資料庫中,因為大多數的資料庫支援從CSV檔案中的資料輸入。這一類的方便的功能是可以跳過欄位如果不是在輸出需要。該領域的陣列提供,提供了一個鍵/值對,
Time of Update: 2016-07-20
php 圖片轉換成ascii 輸出映像php 圖片轉換成ascii 輸出映像這個PHP函數建立了一個簡單的JPG映像ASCII藝術渲染。它使用廣東做繁重的工作,和一些簡單的移位分配色彩。顏色,然後轉移到十六進位值和產生的文本輸出到瀏覽器。 ASCII碼從影像藝術與PHP現在,很容易。如果你覺得你有什麼改進,請隨時與我們聯絡,您的想法PHPRO。function image2ascii( $image ) { // return value $ret = ''; //
Time of Update: 2016-07-20
SMS Web Sender DemoSMS Web Sender DEMO!if ($action != "submit") {?>Any username or password you enter here will not be stored in any way (although we're not using SSL either)Also, as you can see most of these are UK sites, not allof them will
Time of Update: 2016-07-20
目錄名稱合法性檢測//目錄名稱合法性檢測function isen($str){$ret="";for($i=0;$i $p=ord(substr($str,$i,1));if(($p57 & $p90 & $p122){nerror("不符合規範!");}$ret.=chr($p);}return
Time of Update: 2016-07-20
實現資料的匯入匯出,資料表結構的匯入匯出********************************************************/ // //包含Mysql資料庫操作檔案 // require_once("MysqlDB.php"); /*********************************************************類 名:MysqlDB**類 編
Time of Update: 2016-07-20
PHP產生扭曲有角度支援中文的圖片驗證碼函數function make_rand($length="32"){//驗證碼文字產生函數 $str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; $result=""; for($i=0;$i$num[$i]=rand(0,61); $result.=$str[$num[$i]]; } return $result; } $checkcode = make_rand(
Time of Update: 2016-07-20
class CsvFieldDump { var $headers; var $fieldnum; function CsvFieldDump($infile){ if(empty($infile)){ die("You must specify a csv file to readn"); } if(!file_exists($infile)){ die("$infile doesn't exist!n"); } $this->infile = $infile;
Time of Update: 2016-07-20
php 文本文字建立產生圖片現在有不少人要產生文本映像。 PHP的GD庫允許我們這樣做就是這樣。這裡我們給出一個簡單的方法,是把映像網頁上使用的電子郵件地址。有人說,這有助於保持電子郵件收割機遠,但其光學字元辨識這仍然是可能的。 // show the correct header for the image type header("Content-type: image/jpg"); // an email address in a string $string =
Time of Update: 2016-07-20
ExcelFileParser處理excel獲得資料 可作大量匯入到資料庫提交表單Excel資料擷取示範 Excel資料擷取示範 提交處理[php]/*** CopyRight (c) 2009,* All rights reserved.* 檔案名稱:* 摘 要:** @author 星期八 ixqbar@hotmail.com* @version*/class IndexAction extends Action{ /*
Time of Update: 2016-07-20
$mymode = FTP_ASCII;$delete = 0;$local_dir = "/my_local_download_directory";$host = "ftp.yahoo.de";$remote_dir = ".";$anonymous = 0;$user = "myusername";核心代碼class myftp { var $connector; var $getback; function connect($ftp_server,
Time of Update: 2016-07-20
php 圖片處理類,縮減,浮水印class Image { /** * @var string $fileName 檔案名稱 * @access private */ private $fileName = ''; /** * @var gd resource $imageResource 原映像 * @access private */ private $imageResource = NULL; /** * @var int $imageWidth 原映像寬 *
Time of Update: 2016-07-20
/** * 進行寫鎖定的測試 * 開啟線程1 */ require("file_lock.php"); $lock = new File_Lock(dirname(dirname(__FILE__)) . "/FileLock.lock"); /** 單個線程鎖定的速度 1s 鐘 3萬次。 **/ /** 兩個線程寫,兩萬的資料 大概要 7s 鐘*/ /** 一個線程寫,一萬的資料 大概要 3.9s 鐘,居然兩個檔案同時寫,要快一點*/ /** 不進行鎖定,一個進程 寫大概要 2.8s