Time of Update: 2017-01-13
由於電腦使用的是Windows 7 32位的系統,有內建的IIS,不想為了PHP而多裝一個伺服器軟體,就去網上找了些有關IIS+PHP的搭建方法,以下是博主根據網上的資料進行的總結,可以為日後用到1.需用到的軟體列表:php-5.2.0-Win32.zipMySQL_5.6.10_win32.zipNavicat_for_MySQL_10.1.7.exe(一款比較實用的MySQL視圖化管理軟體)下載地址:IIS+PHP安裝包.zip2.環境的搭建:首先安裝好IIS,PHP,MySQL
Time of Update: 2017-01-13
/** * @ string $str 要編碼的字串 * @ string $ende 操作ENCODE編碼,DECODE解碼 * @ string $key hash值 * @return string */function code($str, $ende, $key = '') { $coded = ''; $keylength = strlen($key); $str = $ende == 'DECODE'
Time of Update: 2017-01-13
<?php//檔案讀取函式function PHP_Read($file_name) {$fd=fopen($file_name,r);while($bufline=fgets($fd, 4096)){$buf.=$bufline;}fclose($fd);return $buf;}?>檔案寫入函式:<?php//檔案寫入函式function PHP_Write($file_name,$data,$method="w") {$filenum=@fopen($
Time of Update: 2017-01-13
<?php教程//=================================== // // 功能:IP地址擷取真真實位址函數 // 參數:$ip - IP地址 // //=================================== function convertip($ip) { $dat_path = '../QQWry.Dat'; if(!preg_match("/^d{
Time of Update: 2017-01-13
此指令碼防止檔案被連結到其他檔案,因為這迫使指令檔被下載之前在下載開始。這個指令碼是非常重要的高度機密的檔案。在此指令碼,filter_var()用於過濾檔案和有效字串驗證的檔案,該檔案使用過濾器將下載的檔案FILTER_SANITIZE_STRING。用PHP標記(“?php)中,使用filter_var()來過濾下載的檔案,並驗證從陣列(mytextfile.txt)檔案,初始化列印與模具的命令指令碼的輸出。結束PHP的標記。見例子:<?php//
Time of Update: 2017-01-13
目錄 1. 什麼是異常 2. d 入門 3. 自訂異常 4. 多個異常 5. 重新拋出異常 6. 程式流的異常 7. 頂層例外處理常式 8. 錯誤碼 9. 摘要 什麼是例外。.隨著PHP
Time of Update: 2017-01-13
<?phptry{ /*** Read in the animated gif ***/ $animation = new Imagick("animation.gif"); /*** Loop through the frames ***/ foreach ($animation as $frame) &
Time of Update: 2017-01-13
<?php error_reporting(E_ALL); $width = 80; /*** the image file to thumbnail ***/ $image = 'spork.jpg'; if(!file_exists($image))
Time of Update: 2017-01-13
<?php /** * * Validate a date * * @param string $date * @param
Time of Update: 2017-01-13
<?php/*** an array of attributes about a dog ***/$array = array('animal'=>'dog', 'name'=>'Offenbach', 'owner'=>'Mr Smith');/*** add the dogs favourite food to the array ***/$array = ($array, 'food', 'postmans leg');/*** print the array **
Time of Update: 2017-01-13
<?phpfunction xmlStringToArray($xmlString) { $xmlString = preg_replace('/<!--.*?-->/s','',$xmlString);
Time of Update: 2017-01-13
代碼如下複製代碼 function _link($url){ $contents = @file_get_contents("$url"); if($contents=="Forbidden" || $contents==""){ $ch = curl_init(); $timeout = 5; curl_setopt ($ch,
Time of Update: 2017-01-13
$fangId = PostGet('houseId'); // 取得地址欄值 $tempArray = array_filter(explode('_',$fangId),"filter"); //以__分成數組並且刪除空數組 if( is_array($tempArray) && !empty( $tempArray ) ) //判斷數組是否有值 { print_r($tempArray);
Time of Update: 2017-01-13
foreach迴圈是一種變異的For迴圈,並允許您遍曆數組中的元素。有兩個不同版本的foreach迴圈。 foreach迴圈的文法如下:foreach (array as value){ code to be executed;} foreach (array as key => value){ code to be
Time of Update: 2017-01-13
<?phpclass My_Lib_Functions {# ********************************************# 對象轉數組# ********************************************function object2array ($obj) { foreach ($obj as $k => $v)
Time of Update: 2017-01-13
<?php class My_Lib_page{ //當前頁 var $page = 1; //每頁顯示條數 var
Time of Update: 2017-01-13
<?phpclass My_Lib_upfile{ var $upfile, $upfile_name, $upfile_size; # $upfile 臨時檔案名稱 $_FILES['tmp_name'] ,$upfile_name 檔案名稱 $_FILES['name'] ,$upfile_size 檔案大小$_FILES['size']; var $new_upfile_name; # 上傳後的檔案名稱 ; var $
Time of Update: 2017-01-13
/* 函數:產生縮圖 MakeBuild("images/a.jpg","news/b.jpg","100"); 參數: echo $BuildFile; 原圖 帶路徑 echo $newFile; 產生的縮圖
Time of Update: 2017-01-13
function testAddslashes($array) { if(!get_magic_quotes_gpc()) { if(is_array($array)) { foreach($array as $key => $val) { $array[$key] = testAddslashes($val); } }
Time of Update: 2017-01-13
//用php curl_init函數$ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, "$url"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_USERAGENT,