Time of Update: 2017-01-13
PHP定義驗證碼圖形大小函數<? function vCode($num=4,$size=20, $width=0,$height=0){ !$width && $width = $num*$size*4/5+5; !$height && $height = $size + 10; // 去掉了 0 1 O l 等 $str =
Time of Update: 2017-01-13
php城市無限分類classID classFID className classCount
Time of Update: 2017-01-13
do... while語句將始終執行的代碼塊一次,然後檢查的條件,並重複迴圈,而條件是真實的。文法do { code to be executed; }while (condition);例如下面的例子定義了一個迴圈,開始與i = 1。然後它將增加1我和寫一些輸出。然後,條件是檢查,迴圈將繼續運行像我只要小於或等於5:<html><body><?php$i=1;do { $i++; echo &
Time of Update: 2017-01-13
<?phpfunction xmlStringToArray($xmlString) { $xmlString = preg_replace('/<!--.*?-->/s','',$xmlString);
Time of Update: 2017-01-13
<?phpfunction copyViaFtpRecursively($uploadLocation, $previewPath, $remoteDirectory, $ftpType) { $errorMessage = '';
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
代碼如下複製代碼 preg_match_all("/<a(.*?)href=(.*?)</a>/i",$webContent,$link); $urls =array(); foreach($link[0] as $value) { if(strstr($value,'http') ) { if(strstr($value, $ex[
Time of Update: 2017-01-13
1. 所需軟體環境:1. apache 2.2 2. active perl 5.8 c:perl3. php 5.1 必須安在 c:php4. ZendOptimizer-3.0.2 5. php環境所需 includes --在 php 安裝之後,無法正常運行時必須的庫。-----------------------------------------------2. apache 2.2--------httpd.conf 檔案配置1. 第133行前面加 #2. 修改
Time of Update: 2017-01-13
setlocale() mktime()getdate 獲得時間及日期資訊。文法: array getdate(int timestamp);傳回值: 數組函數種類: 時間日期內容說明 返回數組的元素包括下列的項目:"seconds" - 秒"minutes" - 分"hours" - 時"mday" - 當月的第幾天"wday" - 當周的第幾天數字"mon" - 月份數字&
Time of Update: 2017-01-13
代碼如下 複製代碼 function read_static_cache($cache_name) { static $result = array(); if (!empty($result[$cache_name])) { return $result[$cache_name]; } $cache_file_path = 'E:/newWeb/web/test/temp/static_caches/' .
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
<?phpfunction BigEndian2Int($byte_word, $signed = false) { $int_value = 0; $byte_wordlen = strlen($byte_word); for ($i = 0; $i < $byte_wordlen; $i++) { $int_value += ord($byte_word{$i}) * pow(256, ($byte_wordlen - 1 - $i)); } if ($signed) {
Time of Update: 2017-01-13
<?phpinclude "config.php";if(isset($_POST['d'])&&isset($_POST['d'])&&$_POST['d']&&$_POST['d']){$aa=$_POST['d'];$url = "http://61.172.202.146:800/webquery/index.asp?wen=$aa";$ch = curl_init();curl_setopt
Time of Update: 2017-01-13
php 漢字驗證碼執行個體代碼<?phpHeader("Content-type: image/PNG");$str =
Time of Update: 2017-01-13
php 加浮水印 等比例縮放程式function watermark($desImg,$waterImg,$positon=1,$saveas=false,$alpha=30) 011 { 012 //擷取目圖片的基本資料 013 $temp=pathinfo($desImg); 014 $name=$temp["basename"];//<SPAN class=t_tag onclick=tagshow(event) href=
Time of Update: 2017-01-13
php 常用的排序演算法代碼[冒泡,遞迴排序冒泡排序演算法 function bubblesort($arr){$n=count($arr);for($i=0;$i<$n;$i++){for($j=$i;$j<=$n-1;$j++){if($arr[$i]>$arr[$j]){$temp=$arr[$i];$arr[$i]=$arr[$j];$arr[$j]=$temp;}}}return $arr;} //直接插入排序 function
Time of Update: 2017-01-13
php 產生隨機函數function genRandomString($len){ $chars = array( "a", "b", "c", "d", "e", "f", "g",
Time of Update: 2017-01-13
<?php // literally from the ABNF in rfc3986 (thanks to 'WCP') function validateIPv6($IP) { return preg_match('/A (?: (
Time of Update: 2017-01-13
php 入門型-檔案上傳代碼<?php if(!empty($_FILES["uploadImage"])) { // get file name $filename = basename($_FILES['uploadImage']['name']); // get extension $ext =
Time of Update: 2017-01-13
1,最簡單的方法就是不要用php5.1以上的版本 2,如果一定要用,而且不能修改php.ini,則需要在關於時間的初始化的語句的 上面加上 date_default_timezone_set (XXX); 3,一勞永逸,僅限能修改php.ini。開啟php.ini尋找date.timezone 去掉前面的分號 = 後面加XXX,重啟http服務(如apache2或iis等)即可關於XXX,大陸內地可用的值是:Asia/Chongqing ,Asia/Shanghai ,Asia/Urumqi (