/*簡單的目錄遞迴函式*/function tree($directory){$mydir=dir($directory);echo "";while($file=$mydir->read()){if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){echo "$file";tree("$directory/$file");}else{echo "$file";}}echo "";$mydir->close();}
//編碼轉換函式function utf8togb($s) {return iconv('utf-8', 'gbk//IGNORE', $s); // IGNORE 參數是遇到不成轉換的字元時忽略}//建議把所有中文欄位用英文別名替換,方便下面操作還有編碼轉換等問題$sql="SELECT [id], [欄目] as typeid, [正題] as title, [作者] as author, convert(text, [本文]) as body FROM [文章表];";$sql =
/*** WNiaoBlog Tag Template ShowTag** @package WNiaoBlog** @subpackage Tag*///Connect the database//include('../include/config.php');/*** CountTag() - Statistics labels appear the number,and the data to be stored in the two array** GetTag() - Access
function template($tpl = 'index',$dir = 'hello'){if(!file_exists($pd = TPL_PATH.$dir.'/'))@mkdir($pd,0777) or die("$pd目錄建立失敗");//如cache/tpl/hello/if(!file_exists($td = TPL.$dir.'/'))@mkdir($td,0777) or die("$td目錄建立失敗");//如data/tpl/hello/$t2p =
$foo = 'Bob'; // 將 'Bob' 賦給 $foo$bar = &$foo; // 通過 $bar 引用 $fooecho $foo.'';$bar = "My name is $bar"; // 修改 $bar 變數echo $bar.'';echo $foo.''; // $foo 的值也被修改?>複製代碼輸出:BobMy name is BobMy name is
/***************@length - length of random string (must be a multiple of 2)**************/function readable_random_string($length = 6){$conso=array("b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","w","x","y","z");$vocal=array("a","e",