首页 > 下载 >  类库下载

  • 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
  • 添加邮箱地址到数据库是很正常的,邮箱地址是一种特殊的形式,我们在添加之前往往是需要验证的,当需要验证邮箱地址是否有效时,本类库刚好就起了作用。

    邮件类库55952018-01-15
  • 数组排序在开发中也会常遇到,在分页的时候我们通常会从数据库取数据然后放到数组中在页面遍历显示出来,这时候可以根据自己的想法去排序,本类库就可以派上用场了。

    其它类库30452018-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