变量与数组
来源:互联网 发布:手机淘宝6.2.1版本 编辑:程序博客网 时间:2024/05/29 11:16
模板文件
——————————————————————————————————————————————————————————————————
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{$name}>的主页</title>
</head>
<body bgcolor="#990000">
————————————
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<{if $dq=='left'}>
<span style="float:left"><{$text}></span>
<{elseif $dq=='right'}>
<span style="float:right"><{$text}></span>
<{else}>
<center><{$text}></center>
<{/if}>
</body>
</html>
————————————
<{include file = "header.tpl"}>
nishi <br />
woshi <br />
归属地:
<select>
<option><{$arr[0]}></option>
<option><{$arr[1]}></option>
<option><{$arr[2]}></option>
</select><br>
出生年月:
<{$birthday.year}>年<{$birthday.month}>月<{$birthday.day[0]}>日 <{$birthday.day[1]}><br>
我是<{$student->name}>,<{$student->sex}>,
年龄<{$student->age}><br>
我的宣言是<{$student->study()}><br>
<{include file = "foot.tpl"}>
——————————————————————————————————————下为php文件——————————————————————
<?php
$address = array('河北','河南','河西');
$birthday = array("year"=>'1990',"month"=>'12',"day"=>array('1','星期一'));
class Stu{
var $name;
var $sex;
var $age;
function study(){
echo "好好学习,天天向上";
}
}
$stu1 = new Stu;
$stu1->name="张三";
$stu1->sex="男";
$stu1->age=15;
include ("libs/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "demo/templates";
$smarty->compile_dir = "demo/templates_c";
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
$smarty->assign("name","李武");
$smarty->assign("arr",$address);
$smarty->assign("birthday",$birthday);
$smarty->assign("student",$stu1);
$smarty->display("test.tpl");
?>
- 变量与数组
- 变量与数组
- 变量与数组
- Javascript:变量与数组
- 数组元素与普通变量
- 二级指针变量与数组
- 数组变量与算术运算
- 数组名与指针变量
- 1.4变量与数组.md
- 变量、数据与数组操作
- 指针与数组,静态变量与auto变量
- 数组名与指针变量的区别
- 变量与数组的浅复制
- Shell——变量与数组
- PHP 变量与数组,非常有用
- 与变量相关扩展-数组(1)
- 与变量相关扩展-数组(2)
- 与变量相关扩展-数组(3)
- DTD难点规整
- 应用smarty
- poj 2828
- 变量调节器(函数)
- 实现数据库到excel文件的下载
- 变量与数组
- PHP中便利数组的一种方式
- 学习方法很重要
- PureFTPd
- 异常 的相关知识
- 常见cmd命令
- 分页显示数据大概思路
- 实现缩略图
- MYSQL__1