如何将PHP脚本插入HTML最好的方法?

时间:2010-06-06 16:35:20

标签: php html insert

我必须为我的网站的每个图像/ css文件插入完整路径,因为url_rewriting并且我正在寻找最负责任的方式来实现它。

我当然能做到:

<img src='<?php echo $full_path; ?>/images/theImg.jpg' alt='alternative text' />

但在某个地方我看到人们这样做,或者其他什么:

<img src='{full_path}/images/theImg.jpg' />

现在你知道第二个例子是如何可能的,或者它只是某个框架的一部分而不能在普通文档中使用?

感谢您的回答,

麦克

2 个答案:

答案 0 :(得分:2)

它只是某个框架的一部分,不能在普通文档中使用。

答案 1 :(得分:1)

如果它不是一个完整的框架,也许它只是像Smarty http://www.smarty.net/

这样的模板引擎