Time of Update: 2017-01-13
代碼如下複製代碼 <html><head><title>第一個php教程程式</title></head><body><?phpecho "hello, 這是第一個php程式";?> </body></html>執行個體二 html代碼講解範例 代碼如下複製代碼 <!doctype
Time of Update: 2017-01-13
這款函數比較實用於資料擷取,一般採集資料時會要指定一個地區的內容,這個代碼就可以執行個體;*/ 代碼如下複製代碼 $str="<!-- fdaf-- -->";echo strip_comments( $str );function strip_comments($data) { $the_rest = $data; $result =
Time of Update: 2017-01-13
session 代碼如下複製代碼 <?php session_start();//session在瀏覽器關閉後馬上失效,需要這樣聲明才能讀寫session $_session['id']='伺服器';//這就是聲明和初始化了,和數組用法一樣 $_session['name']='會話'; print_r($_session);//會話註冊成功輸出一個數組 echo "<br>"; $_session['id']='還是伺服器'
Time of Update: 2017-01-13
如果您的使用者找不到他要的頁面,如何給他一個友好的回覆,並且你也知道發生了這個錯誤呢,看看下面這段程式,是用來定製404錯誤頁面和發通知給網管的好東西。---teaman翻譯整理 <?php # 設定 $domain 為你的網域名稱 (注意沒有www) $domain = "oso.com.cn"; # 設定URL,注意沒有後劃線 / $docroot = "http://www.oso.com.cn"; # 設定錯誤資訊的字型 $fontface = "Verdana"; # 設定404
Time of Update: 2017-01-13
if( isset($_FILES['upImg']) ){ if( $userGroup[$loginArr['group']]['upload'] == 0 ) { echo '{"error":"您所在的使用者組無權上傳圖片!"}'; } else { $savePath =
Time of Update: 2017-01-13
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><?phpset_time_limit(0);?><html xmlns="http://www.w3.org/1999/xhtml"><head>&
Time of Update: 2017-01-13
global $charset; if(strlen($string) <= $length) { return $string; } $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); $strcut =
Time of Update: 2017-01-13
代碼如下複製代碼 int preg_match ( string pattern, string subject [, array matches [, int flags]]) 在 subject 字串中搜尋與 pattern 給出的Regex相匹配的內容。如果提供了 matches,則其會被搜尋的結果所填充。$matches[0] 將包含與整個模式比對的文本,$matches[1] 將包含與第一個捕獲的括弧中的子模式所匹配的文本,以此類推。
Time of Update: 2017-01-13
//下面的函數用於查prfunction zeroFill($a, $b) { $z = hexdec(80000000); if ($z & $a) { $a = ($a>>1); $a &= (~$z); $a |= 0x40000000; $a = ($a>>($b-1)); } else
Time of Update: 2017-01-13
ajax無重新整理聊天室這裡是用php+ ajax實現聊天室的資料庫結構sql:CREATE TABLE `message` ( `mid` int(20) NOT NULL auto_increment, `msg` varchar(255) NOT NULL, `user` varchar(50) NOT NULL, `time` int(10) NOT NULL, PRIMARY
Time of Update: 2017-01-13
class GetImage { var $source;var $save_to;var $quality; function download($method = 'curl') { $info = @GetImageSize($this->source); $mime = $info['mime']; // What sort of image? &
Time of Update: 2017-01-13
php 分頁類函數function getPageBar($count = 0){ $bad_link_color = "#C0C0C0"; $page["url"] =
Time of Update: 2017-01-13
php實用執行個體 採集遠程網站圖片儲存到本地先從文章中把所有<img ...> 用正則 摳出來. $message //文章內容 //正則(這個還不是) $reg = "/<img[^>]*src="(http://(.+)/(.+).(jpg|gif|bmp|bnp))"/isU";
Time of Update: 2017-01-13
php實用圖片浮水印效果代碼<?phpdefine('Water',1);//浮水印方式(0,文字浮水印,1圖片浮水印)define('WaterImg','./water.jpg');//浮水印圖片地址define('WaterNum',0);//浮水印位置,0為隨機,1-9分別為頂左頂中頂右中左中中中右底左底中底右define('WaterX',81);//浮水印長define('WaterY',81);//浮水印高define('WaterType','image/jpeg');//
Time of Update: 2017-01-13
//這個是後台管理當中的分類列表頁//包含無限分類include ROOT.'include/tree.class.php';//聲明無限分類$tree = new tree();//設定緩衝目錄$tree->cDir = ROOT.'cache/class/';//讀入分類緩衝$tree->getCache('class');//擷取緩衝$rootArray = $tree->nodes;
Time of Update: 2017-01-13
<?php/** * 上傳檔案 * to : uploadBoroughThumb|borough|picture * to : 函數名|目錄分類|圖片類型 * */require('path.inc.php');$to = $_GET["to"];$action = $_GET['action'];if($action==""){ $action = "form";}
Time of Update: 2017-01-13
echo ccStrLen($str),'<hr>';echo ccStrLeft($str,3);function ccStrLeft($str,$len) #從左邊截取中英文混合字串{$ascLen=strlen($str); if($ascLen<=$len) return $str;$hasCC=ereg("[xA1-xFE]",$str);
Time of Update: 2017-01-13
/***分頁函數***/function multi($total, $perPage, $curPage, $pageUrl, $maxPages = 0, $page = 10, $autoGoTo = TRUE, $simple = FALSE) { $multiPage = ''; $pageUrl .= strpos($pageUrl, '?') ? '&' : '?'; $realPages = 1; if($total
Time of Update: 2017-01-13
本文章來講一個簡單的關於strrpos explode is_array等函數的使用方法哦,關於strrpos判斷字元中是否存在要查的字元strrpos($j_rs->selectedjob,'-')關於explode判斷把字元以什麼形式開成數組array = explode('-',$j_rs->selectedjob);is_array判斷當前參數是否是數組is_array( $array )$ja ='0';$jb
Time of Update: 2017-01-13
function getvis(&$pagesid,&$retime) { global $err,$conf,$HTTP_COOKIE_VARS,$_COOKIE; if(isset($_COOKIE['ant'])) $cot=$_COOKIE['ant']; elseif(isset($HTTP_COOKIE_VARS['ant'])) $cot=$HTTP_COOKIE_VARS['ant']; else $cot='';&