Heim > Herunterladen > Bibliothek herunterladen
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']=''; //Der Preis des Produkts //$param['currency']='CNY' //Währungstyp //$param[' notificationURL' ]=self::NOTIFYURL; //https abgesicherter Modus //$param['returnURL']=self::CALLBACKURL; //$param['externalKey']=$order_id; Zu identifizierende Händler Der externe Schlüssel dieser Bestellung muss eindeutig sein //$param['itemDesc']=''; //Bestellbeschreibung //$param['phoneNumber']=' ' ; //Handynummer des Kunden //$param['settlementType']=0;
Es ist normal, eine E-Mail-Adresse zur Datenbank hinzuzufügen. Wir müssen sie oft überprüfen, bevor wir sie hinzufügen. Diese Bibliothek kommt ins Spiel.
Array-Sortierung kommt in der Entwicklung häufig vor. Normalerweise rufen wir Daten aus der Datenbank ab und legen sie in einem Array ab, um sie während des Seitendurchlaufs anzuzeigen. Diese Klassenbibliothek kann sie versenden ist praktisch.
In unserer tatsächlichen Entwicklung müssen wir auch viele Datenformate verwenden. Natürlich ist das Zusammenführen von Arrays sehr zeitaufwändig.
<?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); } ?>Chinas normale GCJ02-Koordinaten ----> BD09-Koordinaten der Baidu-Karte >Chinas normale GCJ02-KoordinatenTencent Map verwendet auch GCJ02-Koordinaten@param double $lat width@param double $lng longitude@return array();
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 ruft automatisch die entsprechende Konstellationsfunktion basierend auf der ID-Nummer ab, gibt dann automatisch die entsprechende Konstellation zurück, gibt automatisch das Geschlecht zurück und bestimmt, ob es sich um einen Erwachsenen handelt
<?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: Cache-Dateispeicherverzeichnis$lifetime: Gültigkeitsdauer der Cache-Datei, in Sekunden$cacheid: Cache-Dateipfad, einschließlich Dateiname$ext: Cache-Dateierweiterung (optional), hier Wird verwendet für die Bequemlichkeit des Anzeigens von DateienDestruktor, prüfen, ob das Cache-Verzeichnis gültig ist, Standardzuweisung, prüfen, ob der Cache gültig ist, in den Cache schreiben$mode == 0, Seiteninhalt über den Browser-Cache abrufen $mode == 1 , erhalte den Seiteninhalt durch direkte Zuweisung (Empfang über den $content-Parameter) $mode == 2 , erhalte den Seiteninhalt durch lokales Lesen (fopen ile_get_contents) (diese Methode scheint unnötig zu sein)
<?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 dirDies ist eine sehr nützliche Klassenbibliothek zum Generieren von QR-Codes in PHP. Freunde, die sie benötigen, können sie herunterladen und verwenden
<?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{ ; } } } }Dies ist eine PHP-Sicherheitsklasse für die Entfernung von Webviren. Sie können die Virendateilistendatei anzeigen, die Virendateiliste anzeigen und die Virenentfernungszeit aufzeichnen.
<?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/>"; }Dies ist eine PHP-Klasse zum Lesen von QR-Codes. Freunde, die sie benötigen, können sie herunterladen und verwenden.
<?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; //Datenbank-Hostprivate $db_pwd; //Datenbank-Benutzernameprivate $db_database; / / Datenbankverbindungsidentifikation;private $result; //Ergebnisressourcenidentifikation des ausgeführten Abfragebefehlsprivate $sql; //Anzahl der zurückgegebenen Einträgeprivate $coding; Datenbankkodierung, gbk, utf8, gb2312private $bulletin = true; //Ob die Fehlerprotokollierung aktiviert werden sollprivate $show_error = false; //In der Testphase werden alle Fehler angezeigt, was Sicherheitsrisiken birgt und geschlossen ist standardmäßigprivate $ is_error = false; // Ob bei Erkennung eines Fehlers sofort beendet werden soll, der Standardwert ist true. Es wird empfohlen, ihn nicht zu aktivieren, da dies für den Benutzer sehr belastend ist sehe nichts
<?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. Unterstützt eine einzelne Get- und Post-Anfrage * 2. Unterstützt mehrere nicht protokollierte Get-Anfragen für Ziele * 3. Unterstützt mehrere parallele Get- und Post-Anfragen für ein einzelnes Ziel * 4. Unterstützt Ajax-Anfragen * 5. Unterstützt benutzerdefinierte Header-Anfragen * 6. Unterstützt benutzerdefinierte Codierungsdatenanforderungen (diese Situation ist etwas ganz Besonderes) * 7. Unterstützt Proxy-Anmeldung * 8. Unterstützt benutzerdefinierte Quellen * 9. Unterstützt Anpassungs-Timeout * 10. Unterstützt das Hochladen von Dateien