$string = "beautiful";$time = "winter";$str = 'This is a $string $time morning!';echo $str. "";eval("$str = "$str";");echo $str;?> 複製代碼輸出:This is a $string $time morning!This is a beautiful winter morning!eval() 函數在CodeIgniter架構裡也有用到。在
class runTime {private $starTime;//開始時間private $stopTime;//結束時間private function getMicTime(){$mictime=microtime();//擷取時間戳記和微秒數list($usec,$sec)=explode(" ",$mictime);//把微秒數分割成數組並轉換成變數處理return (float)$usec+(float)$sec;//把轉換後的資料強制用浮點點來處理}public
$conn=mysql_connect("localhost","root","myoa888");mysql_select_db("lost63",$conn) or die("select db error");$sql[]="Create TABLE `lost63`.`dd_book_class` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`classname` VARCHAR( 50 ) NOT NULL ,`classid`
/*簡單的目錄遞迴函式*/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();}
/*** 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 =