Time of Update: 2017-01-13
php 儲存遠程伺服器圖片代碼<?phpfunction getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec);}function
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常用緩衝方式入門教程第一種,把需要緩衝的資料進行處理,形成PHP可以直接執行的檔案。在需要快取資料的時候,通過include方式引入,並使用。第二種,把需要的資料通過serialize函數序列化後直接儲存到檔案。在需要使用緩衝資料的時候,通過還原序列化讀入檔案內容並複製給需要的變數,然後使用。測試結果:通過測試我們發現,第二種也就是serialize快取資料的方式更加高效。(資料略去,最後提供了文章地址下載,大家可以自行測試)原因分析:include方式讀取緩衝的時候,PHP需要執行幾個過
Time of Update: 2017-01-13
php 批量產生縮圖代碼//建立目錄(目錄, [模式])function mkdirs($l1, $l2 = 0777){if(!is_dir($l1)){ //如果目錄不存在,遞迴建立 mkdirs(dirname($l1), $l2); return @mkdir($l1, $l2);}return true;}//儲存檔案(檔案, [內容])function savefile($l1, $l2=''){ if(function_
Time of Update: 2017-01-13
php fscokopen實現資料非同步呼叫代碼我們就可以使用fsockopen串連到本機伺服器,觸發指令碼執行,然後立即返回,不等待指令碼執行完成。 function triggerRequest($url,$post_data=array(),$cookie=array())…{ $method="GET";
Time of Update: 2017-01-13
php 面試題猴王演算法<?php/** filename: kingmonkey.php* author: luochuan wang* date: April 2nd, 2009* descript: an arithmetic to a program* program: 一群猴子排成一圈,按1,2,...,n依次編號。 然後從第1隻開始數,數到第m只,把它踢出圈, 從它後面再開始數,
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
if(!isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = substr($_SERVER['argv'][0],strpos($_SERVER['argv'][0],';') + 1); } /* +------------------------------------------- + Fix: Success +--------------
Time of Update: 2017-01-13
<?php $tempquery = mysql_query("select dpb,facejtype from zgy_member_p_d_basic where dpb = '$city' and facejtype like '%$keyword%' "); $count = mysql_num_rows( $tempquery )
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
<head><meta http-equiv="Content-Type" ontent="text/html; charset=gb2312" /><title>表單元素[select下拉式清單]製作二級聯動菜單</title><?php$link = mysql_connect('localhost','root','root') or die(
Time of Update: 2017-01-13
$message //文章內容 //正則(這個還不是) $reg = "/<img[^>]*src="(http://(.+)/(.+).(jpg|gif|bmp|bnp))"/isU"; //把摳出來的 img 地址存放到 $img_array 變數中
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
下面我們一一看講一下這些函數的使用教程吧。in_array($array)這個函數是判斷當前值是否為數組哦EX:$array= array(1,2);if( in_array( $array ) ){ die('in_array判斷它是數組');}echo '不是數組';result:in_array判斷它是數組trim($value)trim函數是去除參數的空值包括null,"
Time of Update: 2017-01-13
我們要使用教程中經常會看到關於如何去除php資料中的空值了,下面我們提供二種去除空值的方法$t=",,,,中國WEB第一站,www.111cn.net"$ar= explode(',',$t);function filter($var) { if($var == '') { return false; }return true; }array_filter($ar,
Time of Update: 2017-01-13
下面這些代碼是一些常用的日期處理函數了,可以兩個時間的日期加減,兩日期之差,日期轉換時間截等。echo date('Y-m-d',strtotime('+1 d',strtotime('2009-07-08')));//日期天數相加函數echo date("Y-m-d",'1246982400');echo '<br>';echo date("Y-m-d",'1279123200');die();$d
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"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta
Time of Update: 2017-01-13
文章為各位提供一個哦,如果喜歡就行了。<?phpif(!defined('DEDEINC')){ exit("Request Error!");}function SpHtml2Text($str){ $str =
Time of Update: 2017-01-13
本文章免費為各位朋友提供一款哦,如果你喜歡的話不防進來看看這款圖片過濾正則表達試function msubstr($str, $start, $len) { $tmpstr = ""; $strlen = $start + $len; for($i = 0; $i < $strlen; $i++) { if(ord(substr($str, $i, 1)) > 0