whois 查詢的PHP代碼

使用下面的函數可以擷取任何網域名稱使用者的完整細節 function whois_query($domain) { // fix the domain name: $domain = strtolower(trim($domain)); $domain = preg_replace('/^http:\/\//i', '', $domain); $domain = preg_replace('/^www\./i', '', $domain); $domain =

PHP擷取使用者的真實 IP

function getRealIpAddr() { if (!emptyempty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!emptyempty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy {

PHP阻止多個 IP 訪問你的網站

這個程式碼片段可以方便你禁止某些特定的 IP 位址訪問你的網站 if ( !file_exists('blocked_ips.txt') ) { $deny_ips = array( '127.0.0.1', '192.168.1.1', '83.76.27.9', '192.168.1.163' );} else { $deny_ips = file('blocked_ips.txt');}// read user ip adress:$ip =

PHP強制性檔案下載

如果你需要下載特定的檔案而不用另開新視窗,下面的程式碼片段可以協助你。 function force_download($file) { $dir = "../log/exports/"; if ((isset($file))&&(file_exists($dir.$file))) { header("Content-type: application/force-download");

使用使用 imagebrick將pdf轉成圖片

$pdf_file = './pdf/demo.pdf';$save_to = './jpg/demo.jpg'; //make sure that apache has permissions to write in this folder! (common problem)//execute ImageMagick command 'convert' and convert PDF to JPG with applied settingsexec('convert "'.$

PHP一個簡單的快速排序

通過不斷的定位基準數的位置來實現快速排序 /** * Created by PhpStorm. * User: saint * Date: 15/8/5 * Time: 上午11:49 */class Demo{ public $a = array(3, 6, 9, 2, 4, 7, 1, 5, 8, 0); public function qsort($left, $right) { if($left > $right) {

PHP通過ffmpeg給視頻增加字幕顯示

$dir = './'; // set to current folderif ($handle = opendir($dir)) { while(false!== ($file = readdir($handle))) { if ( is_file($dir.$file) ){ if (preg_match("'\.(avi)$'", $file) ){ $sub_file = str_ireplace(".avi", ".srt", $dir.$file); $idx_file = str_

PHP敏感字過濾代碼

$f = file('words.txt');$words = array();foreach ($f as $w) { $words[] = preg_quote(trim($w), '/');}$text = file_get_contents('text.txt'); $start = microtime(true);$reg = '/' . implode('|', $words) . '/S'; preg_match_all($reg, $text, $m); $result =

PHP 列出 MySQL 中所有的資料庫

define( 'NL', "\n" );define( 'TB', ' ' );// connecting to MySQL.$conn = @mysql_connect( 'localhost', 'username', 'password' ) or die( mysql_errno().': '.mysql_error().NL );// attempt to get a list of MySQL databases// already set up in my

給圖片添加浮水印的PHP類

支援文字浮水印、圖片浮水印支援浮水印的位置隨機或固定(九宮格)浮水印透明度設定(圖片浮水印和文字浮水印都支援)文字 浮水印的字型、顏色、大小設定圖片浮水印的背景透明 /** * 加浮水印類,支援文字圖片浮水印的透明度設定、浮水印圖片背景透明。 * 日期:2011-09-27 * 作者:www.itwhy.org * 使用: * $obj = new WaterMask($imgFileName); //執行個體化對象 * $obj->$waterType =

PHP下載/採集遠程圖片到本地

/** * 下載遠程圖片到本地 * * @param string $url 遠程檔案地址 * @param string $filename 儲存後的檔案名稱(為空白時則為隨機產生的檔案名稱,否則為原檔案名稱) * @param array $fileType 允許的檔案類型 * @param string $dirName 檔案儲存的路徑(路徑其餘部分根據時間系統自動產生) * @param int $type 遠程擷取檔案的方式 * @return json 返迴文件名、檔案的儲存路徑 *

PHP利用GD庫實現一個簡單的驗證碼

$img=imagecreatetruecolor(100, 40);$red=imagecolorallocate($img, 255, 0, 0);$green=imagecolorallocate($img, 0, 255, 0);$blue=imagecolorallocate($img, 0, 0, 255);$white=imagecolorallocate($img, 255, 255, 255);$black=imagecolorallocate($img, 0, 0, 0);/

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 =

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 擷取指定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,

PHPZip的使用

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

php圖片上傳方法

public function lbt() { $ajax = input::get('ajax',''); if($ajax == '1'){ if(!empty($_FILES)){ $fileDir = public_path().'/test/'; $newFile = $fileDir.$_FILES["myfile"]["name"];

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

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

總頁數: 5203 1 .... 3112 3113 3114 3115 3116 .... 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.