Time of Update: 2017-01-13
class Cache{ protected $_cacheDir; public function __construct() { $this->_cacheDir = "./cache"; } public function setCacheDir($cacheDir) { if(empty($cacheDir)){ $this-
Time of Update: 2017-01-13
class SubPages{ private $each_disNums;//每頁顯示的條目數 private $nums;//總條目數 private $current_page;//當前被選中的頁 private
Time of Update: 2017-01-13
<?php class Shtml{ var $DataSource; //array var $Templet; //string var $FileName; //
Time of Update: 2017-01-13
//php教程 curl執行個體 代碼如下複製代碼 session_write_close();$pageurl = "http://www.111cn.net/index.html"; curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt ($ch, curlopt_url, $pageurl ); $html = curl_exec ( $ch );
Time of Update: 2017-01-13
代碼如下 複製代碼 function getRelativePath($a, $b) { $returnPath = array(dirname($b)); $arrA = explode('/',
Time of Update: 2017-01-13
我們下面要提供的這幾款php教程 流量統計代碼是基礎文字檔的無需資料庫教程,下面我們開始從簡單的到複雜的網頁訪問次數計數器代碼執行個體吧。 代碼如下複製代碼 <HTML><HEAD><TITLE>基於檔案系統的頁面計數器範例</TITLE></HEAD><BODY><?PHP$countfile =
Time of Update: 2017-01-13
會用到的檔案用num.txt //累計訪問次數vist.php//測試檔案count.php//統計訪問次的核心程式,因為它會把文字轉換成gif圖片,並且輸出到瀏覽器。 代碼如下複製代碼 <HTML><HEAD><TITLE>圖形計數器範例</TITLE></HEAD><BODY>您好,您是第<img src="ImgOutFileCount.php">位訪客
Time of Update: 2017-01-13
/*sql資料庫教程結構-- phpMyAdmin SQL Dump-- version 2.11.6---- 主機: localhost-- 產生日期: 2009 年 11 月 08 日 08:22-- 伺服器版本: 5.0.51-- PHP 版本: 5.2.6SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!401
Time of Update: 2017-01-13
function outPege($ps教程,$page){// $ps 累計資訊數 $page 當前page數 $max 列表的最大數 $min 列表的最小值$max = ($page >= 5)? $page+5:10;if($max > $ps)$max =$ps;$min =($page-5); if($min<1) $min =1;if($page&
Time of Update: 2017-01-13
//方法一 代碼如下複製代碼 $str = '<a href="http://www.111cn.net" target="_blank" name="doc3_p"><img src="" onload="setImgSize(this,170,170);"></a>';
Time of Update: 2017-01-13
/*字串A:"1,3,4,5,6,7,8,9,10,11,12,14,15,17,20,22,123,457",例如我想知道這個字串裡面是否含有"2",這時候"12","20","22"等*///一 代碼如下複製代碼 if(in_array('2',explode(',',$str)) //二 代碼如下複製代碼 $str= '1,3,4,5,6,7,8,9
Time of Update: 2017-01-13
//方法一 代碼如下 複製代碼 echo preg_replace('#[x{4e00}-x{9fa5}]#ue','chinese_unicode("\0")',"您好,中國");//保證"您好,中國"是utf-8。 function chinese_unicode($c) {
Time of Update: 2017-01-13
代碼如下複製代碼 <?function download($file_dir,$file_name)//參數說明://file_dir:檔案所在目錄//file_name:檔案名稱{ $file_dir = chop($file_dir);//去掉路徑中多餘的空格 //得出要下載的檔案的路徑 if($file_dir != '')
Time of Update: 2017-01-13
代碼如下複製代碼 <html><head> <title>計數器</title><head> <body><?PHP $countfile = "counter.txt"; //定義計數器寫入的檔案是目前的目錄下的www.111cn.net.txt檔案中,然後我們應當測試該檔案能否開啟 if (($fp = fopen($countfile, "r+")) ==
Time of Update: 2017-01-13
<?if(!$UploadAction):?> 代碼如下複製代碼 <HTML><HEAD><TITLE>檔案上傳介面</TITLE></HEAD><BODY><table><tr align="center"><td><form ENCTYPE="multipart/form-data"
Time of Update: 2017-01-13
代碼如下複製代碼 $im = imagecreatefromjpeg($_file["upload"]["tmp_name"]); //你要打水例子的圖片$watermark = imagecreatefrompng("Smiley.png"); //浮水印圖的路徑$im_x = imagesx($im);$im_y = imagesy($im);$w_x = imagesx($watermark);$w_y =
Time of Update: 2017-01-13
$tmpBody = "fjka;fjsa;{page}批量產生分成檔案並且加上分頁代碼"; $tmpUrl = 'www.111cn.net'; $tmpUrlarray = explode('.',$url); $tmpArray =
Time of Update: 2017-01-13
1、建構函式__construct如果在類申明中__construct函數,將被當成一個建構函式並且在對象建立時被執行,但在php4中,建構函式的名稱與類名相同就是建構函式哦,這一點有一些不同。2、解構函式__destruct如果在php類中申明了,在對象被銷毀時調用__destruct函數下面來看個執行個體 代碼如下複製代碼 <?phpclass Session{ public function __construct(
Time of Update: 2017-01-13
看個執行個體 代碼如下複製代碼 <?phpclass Cart{ var $items; // 購物車中的項目 // 把 $num 個 $artnr 放入車中 function add_item ($artnr, $num) {
Time of Update: 2017-01-13
<?//php教程最簡單擷取數組最後無素值 代碼如下複製代碼 //方法一$url ='www.111cn.net.cc';$tmpUrl = explode('.',$url); //輸出temurl看看print_r($tmpUrl);/*結果: 代碼如下複製代碼 Array( [0] => www [1] => 111cn [