Copy CodeThe code is as follows:
$a = Array (
' A ', ' B ', ' C '
);
Require ' template/demo.php ';//reference template
?>
Template file:
Copy CodeThe code is as follows:
<title>Template testing</title>
complex The Code code is as follows:
!--? php foreach ($a as $value) {?--"
Key value:"!--? = $value?--"
"!--? php}?--"
Iteration of the array
//smarty:
{foreach Item=na from= $a key=key}
Key value: {$key}
{/foreach}
//For PHP programmers that better understand?
//smarty parsing template also use regular, PHP regular efficiency is not high where to go ...
http://www.bkjia.com/phpjc/325311.html www.bkjia.com true http://www.bkjia.com/phpjc/325311.html techarticle Copy code code as follows: PHP $a = array (' A ', ' B ', ' C '); require ' template/demo.php ';/ Reference template? Template file: Copy code code as follows:! DOCTYPE HTML HTML lang= "zh" head ...