PHP郵件操作類

class smtp{var $smtp_port;var $time_out;var $host_name;var $log_file;var $relay_host;var $debug;var $auth;var $user;var $pass;var $sock; function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass){$this->debug = true;$this->smtp_port =

很簡單的一個socket用戶端PHP類

php 5,需要開啟socket擴充 //socke操作類class Socket { private $host;//串連socket的主機 private $port;//socket的連接埠號碼 private $error=array(); private $socket=null;//socket的串連標識 private $queryStr="";//發送的資料 public function __construct($host,$port) {

驗證身份證是否合法的PHP函數

/** * 身份證 * * @param string $id * @return boolean */function is_idcard( $id ){ $id = strtoupper($id); $regx = "/(^\d{15}$)|(^\d{17}([0-9]|X)$)/"; $arr_split = array(); if(!preg_match($regx, $id)) { return FALSE;

php加密解密處理類

class SysCrypt { private $crypt_key; // 建構函式public function __construct($crypt_key) { $this -> crypt_key = $crypt_key;} public function php_encrypt($txt) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0,32000)); $ctr = 0; $

PHP PDO操作MYSQL封裝類

/** * auther soulence * 調用資料類檔案 * modify 2015/06/12 */class DBConnect{ private $dbname = null; private $pdo = null; private $persistent = false; private $statement = null; private $lastInsID = null; private static $_instance = [];

PHP無限分類[增強版]

/** +------------------------------------------------ * 通用的樹型類 +------------------------------------------------ * @author yangyunzhou@foxmail.com +------------------------------------------------ * @date 2010年11月23日10:09:31 +------------------------

PHP 擷取指定URl頁面中所有連結

//擷取指定URL頁面中所有連結 function get_url_href($url){ $html = file_get_contents($url); $dom = new DOMDocument(); @$dom->loadHTML($html); $xpath = new DOMXPath($dom); $hrefs = $xpath->evaluate('/html/body//a')

php日期處理代碼

echo "";echo date("Y-m-d",strtotime("now")), "\n";echo "";echo date("Y-m-d",strtotime("-1 week Monday")), "\n";echo "";echo date("Y-m-d",strtotime("-1 week Sunday")), "\n";echo "";echo date("Y-m-d",strtotime("+0 week Monday")), "\n";echo "";echo

判斷使用者是否使用代理的PHP代碼

/******************************************************* isProxy* check whether client is under Proxy or not* $_SERVER['HTTP_X_FORWARDED_FOR'] is pivotal here* if client is under Proxy, returns true* if client is not under Proxy,

php的AES加密解密

php代碼,php很多東西都是提供好的,直接用函數,但是php目前所知填充模式只有ZeroPadding,於是其他語言就只能跟著它來了: $privateKey = "1234567812345678";$iv = "1234567812345678";$data = "Test String";//加密$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $privateKey, $data, MCRYPT_MODE_CBC, $iv)

PHPZip的使用

class PHPZip{function Zip($dir, $zipfilename){ if (@function_exists('gzcompress')) { $curdir = getcwd(); if (is_array($dir)) { $filelist = $dir; } else {

比較全的資料庫操作PHP類

class database { private $hostname; private $user; private $pass; private $dbname; private $linkflag; private $charset; function __construct() { $this->hostname="localhost";

一種 PHP 判斷裝置是否是手機/平板的代碼

在做web開發的時候經常會需要用到對行動裝置的頁面匹配,當然可以直接把網站做成響應式的,但如果不想這麼做的話,可以使用PHP對裝置類型進行判斷, 然後顯示相應的介面和內容。今天分享一種使用 PHP 判斷裝置是否是手機/平板的方法,方法來源於WordPress(wp-includes/vars.php:125),適用於大部分類型的手機/平板判 斷: /** * Test if the current browser runs on a mobile device (smart phone,

PHP驗證碼檔案類

class CCheckCodeFile{//驗證碼位元private $mCheckCodeNum = 4; //產生的驗證碼private $mCheckCode = ''; //驗證碼的圖片private $mCheckImage = ''; //幹擾像素private $mDisturbColor = ''; //驗證碼的圖片寬度private $mCheckImageWidth = '80'; //驗證碼的圖片寬度private $mCheckImageHeight = '

使用PHPExcel庫

使用前請引入PHPExcel庫 /** * excel 寫入,基於PHPExcel庫 * @param array $data * @param $file * @return bool * @throws PHPExcel_Exception * */function excel_insert(array $data,$file){// $data = [// '庫房'=>[// ['庫房編號','庫房名詞',1],//

用php過濾表單提交中的危險html代碼

PHP過濾提交表單的html代碼裡可能有被利用引入外部危險內容的代碼。例如,有些時候使用者提交表單中含有html內容,但這可能造成顯示頁面配置混亂,需要過濾掉。 function uhtml($str) { $farr = array( "/\s+/", //過濾多餘空白 //過濾 等可能引入惡意內容或惡意改變顯示布局的代碼,如果不需要插入flash等,還可以加入的過濾 "/]*?)>/isU",

陽曆到農曆轉換的一個PHP類

//PHP陽曆到農曆轉換的一個類class Calendar{#農曆每月的天數 var $everyCMonth=array( 0=>array(8,0,0,0,0,0,0,0,0,0,0,0,29,30,7,1), 1=>array(0,29,30,29,29,30,29,30,29,30,30,30,29,0,8,2), 2=>array(0,30,29,30,29,29,30,29,30,29,30,30,30,0,9,3), 3=>array(5,29,30

PHP下載檔案代碼【可自命名】

採用get方式傳入參數http://domain/download.php?file='savepath on server'&name='file name you want' //傳入檔案路徑和檔案名稱,分別用於讀取檔案和重新命名檔案if( empty($_GET['file']) || empty($_GET['name'])){ echo'';

PHP刪除目錄和目錄內所有的下級目錄、檔案代碼

//PHP刪除目錄和目錄內所有的下級目錄、檔案代碼 function delDir( $dirName='' ){ if ( $handle = opendir( "$dirName" ) ) { while ( false !== ( $item = readdir( $handle ) ) ) { if ( $item != "." && $item != ".." ) {

PHP傳統檔案上傳和Base64位檔案上傳

一、基本知識 通過使用 PHP 的全域數組 $_FILES,你可以從客戶電腦向遠程伺服器上傳檔案。 第一個參數是表單的 input name,第二個下標可以是 "name", "type", "size", "tmp_name" 或 "error"。就像這樣: $_FILES["file"]["name"] - 被上傳檔案的名稱 $_FILES["file"]["type"] - 被上傳檔案的類型 $_FILES["file"]["size"

總頁數: 5203 1 .... 1695 1696 1697 1698 1699 .... 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.