Home >Backend Development >PHP Tutorial >The simplest organic compound PHP native template engine The simplest template engine

The simplest organic compound PHP native template engine The simplest template engine

WBOY
WBOYOriginal
2016-07-29 08:48:281053browse

Copy the 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:





& lt ;meta http-equiv="Content-Type" c />
Template test


 

 



Copy the code The code is as follows:



Key value:


// Array iteration
//smarty:
{foreach item=na from=$a key=key}
Key value: {$key}

{/foreach}
//For PHP programmers, which one is better understood Woolen cloth?
//smarty also uses regular expressions to parse templates. PHP’s regular expressions are not that efficient...

The above has introduced the simplest organic compound PHP native template engine. The simplest template engine includes the simplest organic compounds. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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