Time of Update: 2017-01-13
php編輯,上傳,修改檔案屬性代碼 m('檔案上傳 '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? '成功' : '失敗')); } // 編輯檔案 elseif ($editfilename && $filecontent) { $fp =
Time of Update: 2017-01-13
php 重新命名與複製檔案 $nname = $nowpath.$newfilename; if (file_exists($nname) || !file_exists($oldname)) { m($nname.' 目標檔案已經存在或者原始檔案不存在'); } else { m(basename($oldname).' 重新命名
Time of Update: 2017-01-13
php 刪除資料表與刪除資料庫//---------------------------刪除資料表function Ebak_Drop($tablename,$dbname){ global $empire; $dbname=RepPostVar($dbname); $empire->query("use
Time of Update: 2017-01-13
php 漢字轉成拼音代碼<?phpfunction utf82gb($utfstr){ // UTF-8漢字轉GBK漢字 if(function_exists('iconv')){ return iconv('utf-8','gbk',$utfstr); } global $UC2GBTABLE; $okstr = ""; if(trim($utfstr)=="") return
Time of Update: 2017-01-13
php執行個體多檔案上傳執行個體代碼 //a = $('<span class="MultiFile-title" title="'+MultiFile.STRING.selected.replace('$file', v)+'">'+MultiFile.STRING.file.replace('$file', v.match(/[^/\]+$/gi)[0])+'</span>'), &
Time of Update: 2017-01-13
class upload_class{private $ptname; //上傳表單名稱;private $udname; //是否以月份建立子目錄(0為否,其他為真);private $ufname; //是否以時間建立檔案名稱(0為否,其他為真);private $ultype; //上傳檔案類型;private $ulsize;
Time of Update: 2017-01-13
class tree{ /** * 產生樹型結構所需要的2維數組 * @var array */ var $arr = array(); /** * 產生樹型結構所需修飾符號,可以換成圖片 * @var array */ var $icon = array('│','├','└'); /** * @access private */ var $ret = '
Time of Update: 2017-01-13
這個檔案上傳類可以上傳gif",".jpg",".jar",".jad",".mid",".mp3",".mid",".bmp",".wav",".rm",".wmv檔案格式哦,如果你還想支援其它的話可以設計$this->file_type();就OK了,。<?phpclass
Time of Update: 2017-01-13
本文章提供一款功能全面的擷取上一級頁面的函數哦,就是來路函數了。function getref(&$ref,&$fullref) { global $err,$conf,$HTTP_GET_VARS,$_GET; if(isset($_GET['anr'])) $refer=$_GET['anr']; elseif(isset($HTTP_GET_VARS['anr'])) $refer=$HTTP_GET_VARS['anr'];
Time of Update: 2017-01-13
<?phpif(function_exists('date_default_timezone_set')){ date_default_timezone_set('Asia/Shanghai'); //設定時區}define("APP_ROOT",dirname(dirname(__FILE__))); //網站根目錄function visitorIP(){ //訪問者IP if($_SERVER['HTTP_X_FORWARDED_FOR']){
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
function GetContent($type){ if( $type ) { if(file_exists('./mail_room.html') ) { $content = file_get_contents(
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
從中文到英語class Google_API_translator {public $out = ""; function translate() { $this->out = ""; $text =
Time of Update: 2017-01-13
class html{ var $dir; var $rootdir; var $name; var $dirname; var $url; var $time; var $dirtype; var
Time of Update: 2017-01-13
function phpUnescape_no($source) { $decodedStr = ""; $pos = 0; $len = strlen ($source); while ($pos < $len) { $charAt
Time of Update: 2017-01-13
function validate($value,$onoff=0,$type=3,$len=100,$msg='填寫錯誤') {if(trim($value) != ""){ //如果有內容 if(!is_int($len))exit("<script language=javascript>alert('長度參數不是數字');</script>");preg_match_
Time of Update: 2017-01-13
global $charset; if(strlen($string) <= $length) { return $string; } $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); $strcut =
Time of Update: 2017-01-13
if($site) { $buffer = @file_get_contents('http://www.baidu.com/s?wd=site%3A' . $site, 'r'); if($buffer) { $BaiduSite = cut($buffer, '找到相關網頁', '篇'); $BaiduSite = str_replace(array('約', ','), '',
Time of Update: 2017-01-13
function my_file_get_contents($url, $timeout=30) { if ( function_exists('curl_init') ) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,