Home >Backend Development >PHP Tutorial >The simplest organic compound PHP native template engine The simplest template engine
Copy the code The code is as follows:
$a = array(
'a','b','c'
);
require 'template/demo.php';// Reference template
?>
Copy code The code is as follows:
Copy the code The code is as follows:
Key value: =$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.