????:<?phprequire __DIR__.'/config/config.php';session_start();class Test{ public $site='php中文網(wǎng)'; public function welcome(){ return'歡迎來(lái)到'
<?php
require __DIR__.'/config/config.php';
session_start();
class Test{
public $site='php中文網(wǎng)';
public function welcome(){
return'歡迎來(lái)到'.$this->site;
}
}
function add($a,$b){
return $a+$b;
}
$test=new Test();
//設(shè)置常量。不用賦值
const SITE_NAME='努力學(xué)習(xí)';
//系統(tǒng)常量
$_POST['username']='天天向上';
$_GET['username']='少兒不努力,老大徒傷悲';
$_SESSION['pass']=sha1('123456');
$smarty->assign('test',$test);
$smarty->display('demo6.html');
?? ???:韋小寶?? ??:2019-02-25 11:56:53
???? ??:寫的很不錯(cuò) Smarty模板引擎有很多的框架都在使用 學(xué)習(xí)好了Smarty模板引擎使用框架來(lái)渲染頁(yè)面就簡(jiǎn)單多了