Time of Update: 2017-01-13
圖象縮減函數參數說明: 代碼如下複製代碼 $srcfile 原圖地址; $dir 新圖目錄 $thumbwidth 縮小圖寬最大尺寸 $thumbheitht 縮小圖高最大尺寸 $ratio 預設等比例縮放 為1是縮小到固定尺寸。 */ function makethumb($srcfile,$dir,$thumbwidth,$thumbheight,$ratio=0){ //判斷檔案是否存在 if
Time of Update: 2017-01-13
copyright : smart-info limited. all right reserved. author : jacky cheung version : 1.1 create date : 24 september 2008 last modify : 15 march 2009*/class gd{
Time of Update: 2017-01-13
代碼如下複製代碼 function imageresize2($width, $height, $targetw, $targeth) { $percentage = 1; if (($width > $targetw) || ($height > $targeth)) { $width_diff = $width - $targetw; $height_diff = $height -
Time of Update: 2017-01-13
開始研究gvim的設定檔(_vimrc), 現在給大家看一下我產生亂碼之前的配置設定檔裡enconding,fileeconding,fileecondings的含義: encoding: gvim 內部使用的字元編碼方式,包括 vim 的 buffer (緩衝區)、菜單文本、訊息文本等。 使用者手冊上建議只在 .vimrc 中改變它的值,事實上似乎也只有在 .vimrc 中改變它的值才有意義。 fileencoding: gvim 中當前編輯的檔案的字元編碼方式,vim
Time of Update: 2017-01-13
require()require() 語句包括並運行指定檔案。require() 語句包括並運行指定檔案。有關包括如何工作的詳細資料見 include() 的文檔。require() 和 include() 除了怎樣處理失敗之外在各方面都完全一樣。include() 產生一個警告而 require() 則導致一個致命錯誤。換句話說,如果你想在丟失檔案時停止處理頁面,那就別猶豫了,用 require() 吧。include() 就不是這樣,指令碼會繼續運行。同時也要確認設定了合適的include_
Time of Update: 2017-01-13
php教程系統時區8小時差設定方法修改php系統時區的兩種方式:1、修改php.ini檔案中的設定,找到[date]下的“;date.timezone=”,將該項修改為date.timezone=asia/hong_kong (prc 中國時間),然後重新啟動apache伺服器。2、在應用程式中,使用時間日期函數之前添加“date_default_timezone_set(“asia/hong_kong”)”函數修改php.
Time of Update: 2017-01-13
include_path 下尋找,然後是當前運行指令碼所在目錄相對的 include_path 下尋找。例如 include_path 是 . ,當前工作目錄是 /www/ ,指令碼中要 include 一個 include/a.php教程 並且在該檔案中有一句 include "b.php" ,則尋找 b.php 的順序先是 /www/ ,然後是 /www/include/ 。如果檔案名稱以 ./ 或者 ../
Time of Update: 2017-01-13
在php教程中中文亂碼解決方案最最覺的是ajax post get 中文亂碼了,用ajax傳遞中文時..ff會很聰明的自動將中文字元轉成十六進位.而bc的ie卻非得自己處理..-____!!最簡單的方法就是在需要轉義的地方使用js的內建函數 encodeuricomponentp.s.最初是用escape做中文轉義..注意它與 encodeuricomponent 的區別php中其它引起亂碼解決方案分析1. php檔案本身的編碼與網頁的編碼應匹配 a.
Time of Update: 2017-01-13
php教程的Regex完全手冊前言 Regex是煩瑣的,但是強大的,學會之後的應用會讓你除了提高效率外,會給你帶來絕對的成就感。只要認真去閱讀這些資料,加上應用的時候進行一定的參考,掌握Regex不是問題。索引 1._引子 2._Regex的曆史 3._Regex定義 3.1_一般字元 3.2_非列印字元 3.3_特殊字元 3.4_限定符 3.5_定位器 3.6_選擇 3.7_後向引用 4._各種操作符的運算優先順序
Time of Update: 2017-01-13
php教程下載jpg檔案為空白解決方案jpg格式的檔案,點擊在瀏覽器中開啟顯示為紅叉代碼如下:$filetype = "image/pjpeg";header("content-type: {$filetype}"); header("expires: 0");header("cache-control: must-revalidate,
Time of Update: 2017-01-13
php教程判斷頁面輸入字元編碼方法<?php function convtoutf8($str) { if( mb_detect_encoding($str,"utf-8, iso-8859-1, gbk")!="utf-8" ) {return iconv("gbk","utf-8",$str);} else { return $str; }}
Time of Update: 2017-01-13
php教程中文目錄 include錯誤解決訪求include_path='.;c:php5pear'的錯誤warning: unknown: failed to open stream: no such file or directory in unknown on line 0fatal error: unknown: failed opening required 'e:/ttttt/中文/index.php' (include_path='.;c:php5pear') in
Time of Update: 2017-01-13
關於php教程處理textarea斷行符號換行替換方法(js調用出錯)在textarea輸入框裡面chr(13)是代表斷行符號,但當我替換時確實可以我要的字元,但是他顯示時斷行符號的地方就會有一個空格,經過反覆調試是有一個n ,這個應該是資料庫教程或程式的斷行符號符吧。--><form name="form1" method="post" action="">
Time of Update: 2017-01-13
session_start();date_default_timezone_set('asia/shanghai');header("cache-control: no-cache, must-revalidate");define('applicaton_root', dirname(__file__));define('sys_root', dirname(dirname(__file__)).'/framework');define('default_control',
Time of Update: 2017-01-13
下面中要在html 中調用就行了<script src=”fckeditor/fckeditor.js”></script> <script type=”text/網頁特效”> function showfck(){ var ofckeditor = new fckeditor('content') ; ofckeditor.basepath = ‘fckeditor/' ;
Time of Update: 2017-01-13
php教程中單引號與雙引號的區別引號中,任何變數($var)、特殊逸出字元(如“t r n”等)不會被解析,因此php的解析速度更快,逸出字元僅僅支援“’”和“”這樣對單引號和反斜線本身的轉義;在字串中使用變數 這個功能讓你無須使用串連符號來粘和大量的簡單字串。php允許我們在雙引號串中直接包含字串變數,我們可以發現下面的兩個字串的處理結果是相同的。$full_name = $first_name . ' '
Time of Update: 2017-01-13
方法1 : 據官方手冊上描述若php教程的safe mode相關的設定過於苛刻,就會出現這樣的情形:儘管檔案真實存在也被誤判,認為檔案不存在。 由於伺服器端的php.ini我們無法操縱,當用ini_set()也關閉不了safe mode模式,我們只有退而求其次,找一個更可靠、安全的檢測方法來檢測檔案是否存在。我們可以藉助 $_server['document_root'] 來加以實現。$_server['document_root']
Time of Update: 2017-01-13
ctrl+y尋找:disable_functions 找到後在=後面添加 (這裡都是禁止在php教程裡面執行的函數)代碼: 複製內容到剪貼簿 exec,system,passthru,error_log,ini_alter,dl,openlog,syslog,readlink, symlink,link,leak,fsockopen,proc_open,popepassthru,chroot,scandir, chgrp,chown,escapeshellcmd,escapeshel
Time of Update: 2017-01-13
常量在使用前必須要定義,否則程式執行會出錯。在php教程中使用define()函數來定義常量。1、文法格式:define("常量名稱","常量的值");例如:define("php360","完美的php");下面還是來一個範例吧: define() 函數定義一個常量。常量類似變數,不同之處在於:在設定以後,常量的值無法更改 常量名不需要開頭的貨幣符號 ($) 範圍不影響對常量的訪問
Time of Update: 2017-01-13
註:如果在用mb_strlen出現fatal error: call to undefined function mb_strlen,這種問題你要可以用php教程info()看一下有沒有裝載mbstring,如果沒有,嘗試將php_mbstring.dll複製到%windows%目錄下。檔案編碼 utf-8$var = '中文字元abc';mb_strlen($var, 'utf-8'); // 輸出7 中文英文都佔一個位元組mb_strlen($var); // 輸出15 中文佔3個位元組