php - string precompilation with tag template
大家讲道理
大家讲道理 2017-05-16 13:14:51
0
2
398

Hello everyone, I encountered a problem when I was using php to do a project.
If you want to output a piece of html content with <?php ... ?>, usually write include or require file name at the end for output.
But I put this HTML content directly in the database. If I want to output it, can I only create a temporary file first, and then use the include temporary file name to output it? Is there any other way?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
滿天的星座

You can directly Eval, but there are security risks

eval(preg_replace('/^<]?php|\?>/', '', str))
给我你的怀抱

For example, the cache after template compilation mostly uses temporary files. If you want to store it in the database, you can also use the eval function. However, it is recommended to use cache files. The database must not be well designed.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template