Home > Backend Development > PHP Tutorial > PHP native template engine The simplest template engine_PHP tutorial

PHP native template engine The simplest template engine_PHP tutorial

WBOY
Release: 2016-07-21 15:19:24
Original
869 people have browsed it

Copy code The code is as follows:

$a = array(
'a','b ','c'
);
require 'template/demo.php';//Reference template
?>

Template file:
Copy code The code is as follows:



< head>

Template Test



 

 



Copy code Code As follows:


Key value:


//Iteration of array
//smarty:
{foreach item=na from=$a key=key}
Key value: {$key}

{/foreach}
//Which one is better understood by PHP programmers?
//smarty also uses regular expressions to parse templates. PHP’s regular expressions are not that efficient...

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325311.htmlTechArticleCopy the code as follows: ?php $a = array( 'a','b','c' ) ; require 'template/demo.php';//Reference template? Template file: Copy the code as follows: !DOCTYPE html html lang="zh" head...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template