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
如果只是unicode轉utf-8編碼的演算法,網上到處都是了,不過很多人也是你抄我,我抄你,根本就不理解why和do,本文除了給出最簡單的php對unicode轉utf-8編碼函數之外,也深入討論了這兩種編碼的關係,理解好了會發現網上一些舊的東西,是嚴重多餘兼到期的,因為從utf-8流行開始到現在,早已經由原來六位元組可變編碼到實際完全居於unicode(UCS-2)的穩定階段。 unicode編碼是實現utf-8與gb系列編碼(gb2312、gbk、gb1
Time of Update: 2017-01-13
php 漢字驗證碼執行個體代碼<?phpHeader("Content-type: image/PNG");$str =
Time of Update: 2017-01-13
php 擷取檔案大小函數與執行個體教程<?php function getFileSize($url){ $url = parse_url($url); if($fp = @fsockopen($url['host'],empty($url['port'])?80:$url['port'],$error)){ fputs($fp,"GET ".(empty($url['path'])?'/':$url['path'])." HTTP/1.1rn");
Time of Update: 2017-01-13
地聽說這個功能需求的時候,立即就蒙了,不騙大家!首先PHP的socket幾乎都沒使用過,其次沒有聽說過post還能用PHP的socket來類比的呢!後來找了個案例看了看,才明白其實沒有那麼高深,只不過戰地還不清楚post的原理和本質而已,其實本質就是發送給目的程式一個標誌為post的協議串如下: POST /目的程式 HTTP/1.1Accept: */*Accept-Language: zh-cn,en-us;q=0.5Content-Type: application/x-www-
Time of Update: 2017-01-13
php 檔案上傳代碼,限制jpg檔案<?php /* 圖片上傳類 www.lost63.com原創代碼 僅限JPG格式圖片 */ class uploadFile { var $inputName; //input名稱
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 execel 匯出xml 程式<?phpclass Excel_XML{ private $header = "<?xml version="1.0" encoding="UTF-8"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:
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 (?: (