Home > Backend Development > PHP Tutorial > php include()字符串,并解析字符串的问题

php include()字符串,并解析字符串的问题

WBOY
Release: 2016-06-23 14:08:25
Original
1052 people have browsed it

我需要include()这样一个字符串
  $str ='1111 ';
要求能输出111和时间,但是现在只能输出111而无法解析时间函数.
求解,谢谢!


回复讨论(解决方案)

$str = "1111 $_SERVER[REQUEST_TIME]";

$str = "1111 $_SERVER[REQUEST_TIME]";
我是想学习模板引擎的原理,所以需要保留的,

需要保留
就需要用 eval

没有一个个模板引擎是像你一维的那样的

需要保留
就需要用 eval

没有一个个模板引擎是像你一维的那样的
嘿嘿,是滴,用字符串确实不好处理。现在的处理方法是:遇到include()递归包含,但是这样有损性能

学习了,好贴

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