Time of Update: 2016-07-25
function my_wp_plugin_tag_action($content,$tag,$function,$args = FALSE) { // match all regular expressions preg_match_all($tag,$content,$matches); if (count($matches)>0) { // filter duplicates $matches = array_unique($matches); // loop
Time of Update: 2016-07-25
搜尋來的,我想用,貼出來,看有木有問題啊! echo $HTTP_HOST 就是要輸出的網域名稱! function PMA_getenv($var_name) {if (isset ( $_SERVER [$var_name] )) {return $_SERVER [$var_name];} elseif (isset ( $_ENV [$var_name] ))
Time of Update: 2016-07-25
在伺服器端完成圖片大小的調整,會比在瀏覽器的處理有很多的好處。 本文介紹了PHP如何在伺服器端調整圖片大小。 程式碼封裝括兩部分: imageResizer() is used to process the image loadimage() inserts the image url in a simpler format function
Time of Update: 2016-07-25
php 利用filter 擴充編寫的參數處理類。 http://www.blags.org/php-security-filter-function/ exp: 首先引入檔案 include 'filter.php' $email = CFilter::Email($_POST['email']); 驗證成功返回字串,反之返回false。 /
Time of Update: 2016-07-25
//年$year = date("Y");$beninTime = mktime(0,0,0,1,1,$year);$endTime = mktime(0,0,0,1,1,$year+1)-1;$weekArray = array();$isBegin = true;$forTime = 0;for ($time=$beninTime;$time$forTime++;$start = $end =
Time of Update: 2016-07-25
/** * Goofy 2011-11-29 * 影像處理:根據傳遞過來的座標參數,x,y,w,h,依次為選取的x座標,y座標,w寬度,h高度 * 通過imagecopy()方法將該地區copy至第一步建立的空白映像中 * 注意,在建立映像的時候要用imagecreatetruecolor()真彩色,不然用imagecreate()圖片會失真 */
Time of Update: 2016-07-25
多內容實現分頁php $aa =
Time of Update: 2016-07-25
function get_http_response_code($theURL) { $headers = get_headers($theURL); return substr($headers[0], 9, 3); }?> 複製代碼get_headers的作用就是訪問一個遠程地址,把伺服器發送的HTTP頭以數組形式返回。而$header[0]則是伺服器返回的狀態代碼(如果不出意外的話狀態代碼應該都是第一個返回的)。排除重新導向的例子: /** * Fetches
Time of Update: 2016-07-25
php實現簡單的日曆類 class calendar{private $year;private $month;private $day_week;function __construct(){$this->year=isset($_GET['year']) ? $_GET['year'] :
Time of Update: 2016-07-25
package com.qimenguigu.l07131;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;/** * 輸入年,月,日,next|prior,如果是一個正確的日期,算出上一天或下一天 * * @author Longjie * @website www.qimenguigu.com */public class Title15 {public
Time of Update: 2016-07-25
session_start();//產生驗證碼圖片Header("Content-type: image/PNG");srand((double)microtime()*1000000);$im = imagecreate(62,20);$black = ImageColorAllocate($im, 69,120,239);$white = ImageColorAllocate($im, 0,0,0);$gray = ImageColorAllocate($im,
Time of Update: 2016-07-25
package com.sjzmlb.test;/** * * @author sjzmlb * */public class TestArray {public static void main(String[] args) {// -----不規則二維數組 ----int[][] ints = new int[5][];for (int i = 0; i ints[i] = new int[i + 1];for (int j = 0; j ints[i][j] = i + 1;}}for
Time of Update: 2016-07-25
jpge圖片與png圖片的融合,其實就是大家熟悉的浮水印技術。下面代碼中最重要的一句為: //設定映像的混色模式 imagealphablending($ground_im, true); /* * 功能:PHP圖片浮水印 (浮水印支援圖片或文字) * 參數: * $groundImage 背景圖片,即需要加浮水印的圖片,暫只支援GIF,JPG,PNG格式; *
Time of Update: 2016-07-25
/*** 建立bmp格式圖片** @author: legend* @description: create Bitmap-File with GD library* @version: 0.1** @param resource $im 映像資源* @param string $filename 如果要另存新檔檔案,請指定檔案名稱,為空白則直接在瀏覽器輸出* @param integer $bit 映像品質(1、4、8、16、24、32位)* @param integer
Time of Update: 2016-07-25
/** * Copyright (c) 2011 - 01 XatuDream * XatuDream All Rights Reserved. * Support:185390516.qzone.qq.com * QQ:185390516 * Author:Lau Version:1.01 * Date:2010-08-12 09:28:32 */! defined ( 'WORKSPACE' ) && exit ( "Access Denied !" );class MD5Crypt {/
Time of Update: 2016-07-25
友言 Uyan 是第三方評論、留言外掛程式。 讓使用者可以通過QQ、微薄等帳號發布評論和留言。 在 羊駝!CMS 中整和 Uyan 方法如下。 以建立友言留言板為例。 0. 訪問 http://uyan.cc/getcode 複製友言代碼 1. 點擊 後台 -> 排版 -> 添加排版 2. 輸入 名稱 ->留言板 代碼 -> 粘帖友言代碼 儲存 3. 點擊 後台-> 內容 -> 添加頁面 4. 輸入 標題 -> 留言板
Time of Update: 2016-07-25
function page_init(){$url = $_SERVER['REQUEST_URI'];//子url,該參數一般是唯一的$pageid = md5($url);$dir = str_replace('/','_',substr($_SERVER['SCRIPT_NAME'],1,-4));//目錄命名方式,如exp_indexif(!file_exists($pd = PAGE_PATH.$dir.'/'))@mkdir($pd,0777) or die("$pd目錄建立失敗")
Time of Update: 2016-07-25
我在看那個ecmall核心檔案ecmall.php,看到這個函數寫得比較清晰,拿出來分享下 function get_domain() { /* 協議 */ $protocol = (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : '
Time of Update: 2016-07-25
//對照表的使用$filename = "gb2utf8.txt";$fp = fopen($filename,"r");while(! feof($fp)) {list($gb,$utf8) = fgetcsv($fp,10);$charset[$gb] = $utf8;}fclose($fp);//以上讀取對照表到數組備用/** gb2312到utf-8 **/function gb2utf8($text, &$charset)
Time of Update: 2016-07-25
//檔案名稱字 $filename = "ip.txt"; if (isset($_SERVER['HTTP_CLIENT_IP'])) { $clientip = $_SERVER['HTTP_CLIENT_IP']; }elseif (isset($_SERVER['HTTP_X_FORWARD_FOR'])) { $clientip = $_SERVER['HTTP_X_FORWARD_FOR']; }else { $clientip =