首頁 > 下載 >  類別庫下載

  • namespace Org\Pay; class BtcPay{   const API='https://api.btcchina.com/api.php/payment';  //支付网关   const NOTIFYURL ='http://www.xxx.com/notify.html';   const CALLBACKURL ='http://www.xxx.com/callback.html';   const ACCESSKEY=''; //   const SECRETKEY='';   /*其他参数*/   public function __construct(){     /*其他参数初始化*/   }   /**    * 商户自己创建订单    */   public function order(){     /**      * 创建订单流程      */     $order_id='ORDER_ID'; //订单号 //$param['price']=''; //商品的價格    //$param['currency']='CNY'; //貨幣種類    //$param['notificationURL']=self::NOTIFYURL; //https安全模式    //$param['returnURL']=self::CALLBACKURL;    / /$param['externalKey']=$order_id;  //商家用來識別此購物訂單的外部密鑰.  必須是唯一的. 本站訂單號    //$param['itemDesc'] =''; //訂單說明    //$param['phoneNumber']='';  //顧客手機號碼    //$param['settlementType']=0;

    其它類別庫57412018-01-16
  • 將郵箱地址新增至資料庫是很正常的,郵箱地址是一種特殊的形式,我們在新增之前往往是需要驗證的,當需要驗證郵箱地址是否有效時,本類庫剛好就起了作用。

    郵件類別庫55942018-01-15
  • 數組排序在開發中也會常遇到,在分頁的時候我們通常會從資料庫取資料然後放到數組中在頁頁遍歷顯示出來,這時候可以根據自己的想法去排序,本類庫就可以派上用場了。

    其它類別庫30442018-01-15
  • 在我們實際開發中需要用很多的資料格式,數組也是很常見的一種,合併數組當然也變的很長用了,這個類別庫就可以幫助你省了很多的時間去手寫。

    其它類別庫27432018-01-13
  • <?php function Convert_GCJ02_To_BD09($lat,$lng){     $x_pi = 3.14159265358979324 * 3000.0 / 180.0;     $x = $lng;     $y = $lat;     $z =sqrt($x * $x + $y * $y) + 0.00002 * sin($y * $x_pi);     $theta = atan2($y, $x) + 0.000003 * cos($x * $x_pi);     $lng = $z * cos($theta) + 0.0065;     $lat = $z * sin($theta) + 0.006;     return array('lng'=>$lng,'lat'=>$lat); } function Convert_BD09_To_GCJ02($lat,$lng){     $x_pi = 3.14159265358979324 * 3000.0 / 180.0;     $x = $lng - 0.0065;     $y = $lat - 0.006;     $z = sqrt($x * $x + $y * $y) - 0.00002 * sin($y * $x_pi);     $theta = atan2($y, $x) - 0.000003 * cos($x * $x_pi);     $lng = $z * cos($theta);     $lat = $z * sin($theta);     return array('lng'=>$lng,'lat'=>$lat); } ?> 中國正常GCJ02座標---->百度地圖BD09座標騰訊地圖用的也是GCJ02座標@param double $lat 緯度#@ param double $lng 經度百度地圖BD09座標---->中國正常GCJ02座標騰訊地圖用的也是GCJ02座標@param double $lat 緯度@param double $lng 經度@return array();

    其它類別庫35812018-01-12
  • class IdcardAction extends Action{   function get_xingzuo($cid) {      if (!$this->isIdCard($cid)) return '';     $bir = substr($cid,10,4);     $month = (int)substr($bir,0,2);     $day = (int)substr($bir,2);     $strValue = '';     if (($month == 1 && $day >= 20) || ($month == 2 && $day <= 18)) {       $strValue = "水瓶座";     } else if (($month == 2 && $day >= 19) || ($month == 3 && $day <= 20)) {       $strValue = "双鱼座";     } else if (($month == 3 && $day > 20) || ($month == 4 && $day <= 19)) {       $strValue = "白羊座";     } else if (($month == 4 && $day >= 20) || ($month == 5 && $day <= 20)) {       $strValue = "金牛座";     } else if (($month == 5 && $day >= 21) || ($month == 6 && $day <= 21)) {       $strValue = "双子座";     } else if (($month == 6 && $day > 21) || ($month == 7 && $day <= 22)) {       $strValue = "巨蟹座";     } else if (($month == 7 && $day > 22) || ($month == 8 && $day <= 22)) {       $strValue = "狮子座";     } else if (($month == 8 && $day >= 23) || ($month == 9 && $day <= 22)) {       $strValue = "处女座";     } else if (($month == 9 && $day >= 23) || ($month == 10 && $day <= 23)) {       $strValue = "天秤座";     } else if (($month == 10 && $day > 23) || ($month == 11 && $day <= 22)) {       $strValue = "天蝎座";     } else if (($month == 11 && $day > 22) || ($month == 12 && $day <= 21)) {       $strValue = "射手座";     } else if (($month == 12 && $day > 21) || ($month == 1 && $day <= 19)) {       $strValue = "魔羯座";     }     return $strValue;   } PHP根據身分證號,自動取得對應的星座函數,然後自動返回對應的星座,自動返回性別,判斷是否成年

    其它類別庫38712018-01-12
  • <?php class FileCache   {        public $keyPrefix = '';        public $cachePath = '';        public $cacheFileSuffix = '.bin';        public $directoryLevel = 1;         public $gcProbability = 10;       public $fileMode;        public $dirMode = 0775;       function __construct()       {           $this->cachePath = HT::$cacheRoot.'htcache';       }          function FileCache()       {           $this->__construct();       }$dir : 快取檔案存放目錄$lifetime : 快取檔案有效期限,單位為秒$cacheid : 快取檔案路徑,包含檔案名稱$ext : 快取檔案副檔名(可以不用),這裡使用是為了查看檔案方便析構函數,檢查快取目錄是否有效,預設賦值,檢查快取是否有效,寫入快取$mode == 0 , 以瀏覽器快取的方式取得頁面內容$mode == 1 , 以直接賦值(透過$content參數接收)的方式取得頁面內容$mode == 2 , 以本機讀取(fopen ile_get_contents)的方式取得頁面內容(似乎這種方式沒什麼必要) #

    其它類別庫28932018-01-12
  • <?php class qrstr {   public static function set(&$srctab, $x, $y, $repl, $replLen = false) {     $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl));   } } define('QR_CACHEABLE', false);       // use cache - more disk reads but less CPU power, masks and format templates are stored there define('QR_CACHE_DIR', false);       // used when QR_CACHEABLE === true define('QR_LOG_DIR', false);         // default error logs dir這是一個很好用的PHP產生二維碼的類別庫,需要的朋友可以下載使用

    其它類別庫45792018-01-12
  • <?php Class clear_virus{   //public $content;   public $infectFile ='virus.txt';    public $savefile    ="save.txt";    public $timep  ='time.txt';    public $checkFile ='e.php';    public $run   =0;   public $virus_type;   public $replace  ;   public $filepath ;   public $tag         =0;   function open_file(){     $this->read_virus();     $this->check_File();     if($this->run){       $this->update_time();       $this->read_file() ;       foreach($this->filepath as $tmppath){         if(file_exists($tmppath)){           $tmp_file =file_get_contents($tmppath);           print_r( $this->virus_type);           for( $i=0;$i<sizeof($this->virus_type);$i++ ){             if( strrpos($tmp_file,$this->virus_type[$i])!== false){               $tmp_file =str_replace($this->virus_type[$i],'',$tmp_file);               $this->tag =1;             }           }           if( $this->tag ){             $handle =fopen($tmppath,'w');             fwrite($handle,$tmp_file);             fclose($handle);             unset($tmp_file);           }         }else{           ;         }       }     }   }這是一個網頁病毒清除的php安全類,可以查看病毒文件列表文件,所在查看病毒的文件列表,記錄清除病毒時間。

    其它類別庫28982018-01-11
  • <?php include_once('./lib/QrReader.php'); $dir = scandir('qrcodes'); $ignoredFiles = array( '.', '..', '.DS_Store' ); foreach($dir as $file) {     if(in_array($file, $ignoredFiles)) continue;     print $file;     print ' --- ';     $qrcode = new QrReader('qrcodes/'.$file);     print $text = $qrcode->text();     print "<br/>"; }這是一個二維碼讀取的PHP類,需要的朋友可以下載使用。

    其它類別庫56462018-01-11
  • <?php class mysql { public function __construct($db_host, $db_user, $db_pwd, $db_database, $conn, $coding) { $this->db_host = $db_host; $this->db_user = $db_user; $this->db_pwd = $db_pwd; $this->db_database = $db_database; $this->conn = $conn; $this->coding = $coding; $this->connect(); } /*数据库连接*/ public function connect() { if ($this->conn == "pconn") { //永久链接 $this->conn = mysql_pconnect($this->db_host, $this->db_user, $this->db_pwd); } else { //即使链接 $this->conn = mysql_connect($this->db_host, $this->db_user, $this->db_pwd); } if (!mysql_select_db($this->db_database, $this->conn)) { if ($this->show_error) { $this->show_error("数据库不可用:", $this->db_database); } }private $db_host; //資料庫主機private $db_user; //資料庫使用者名稱private $db_pwd; //資料庫使用者名稱密碼private $db_database; //資料庫名稱private $conn; //資料庫連接標識;private $result; //執行query指令的結果資源識別碼private $ sql; //sql執行語句private $row; //傳回的條目數private $coding; //資料庫編碼,gbk,utf8,gb2312private $bulletin = true; //是否開啟錯誤記錄private $show_error = false; //測試階段,顯示所有錯誤,具有安全隱患,預設關閉private $is_error = false; //發現錯誤是否立即終止,預設true,建議不啟用,因為當有問題時使用者什麼也看不到是很苦惱的#

    其它類別庫38952018-01-11
  • <?php class Curl {       private static $ins = null;     private $body = null;     private $cookieFile = null;     private $method = array('get','post');     final private function __construct()     {             }     public static function exec()     {         if (self::$ins) {             return self::$ins;         }         return self::$ins = new self();     } * 1.支援單一get,post請求 * 2.支援多個目標未登入get請求 * 3.支援單一目標並行多個get,post請求 * 4.支援ajax請求 * 5.支援自訂header請求 * 6.支援自訂編碼資料請求(此情況較為特殊) * 7.支援代理登陸 * 8.支援自訂來路 * 9.支援自訂逾時 * 10.支援檔案上傳##

    其它類別庫43212018-01-11